Build #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Build | |
on: | |
push: | |
branches: | |
- "**" | |
pull_request: | |
branches: | |
- master | |
schedule: | |
- cron: '30 13 * * *' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 120 | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Build | |
working-directory: "." | |
shell: bash | |
run: | | |
function log | |
{ | |
declare -rAi TAG=( | |
[error]=31 | |
[info]=32 | |
[audit]=33 | |
) | |
printf '%(%y-%m-%d_%T)T\x1b[%dm\t%s:\t%b\x1b[0m\n' -1 "${TAG[${1,,:?}]}" "${1^^}" "${2:?}" 1>&2 | |
if [[ ${1} == 'error' ]]; then | |
return 1 | |
fi | |
} | |
export -f log | |
if [[ ${RUNNER_OS} == "Linux" ]]; then | |
log 'info' 'Download dep' | |
sudo apt-get update | |
sudo apt-get install -y ninja-build lib{x11,xext,xft,xinerama,xcursor,xrender,xfixes,pango1.0,gl1-mesa,glu1-mesa,xdo,xcb-randr0}-dev | |
log 'info' 'Cargo Clippy' | |
cargo clippy --quiet | |
log 'info' 'Cargo Build' | |
cargo build --quiet --release | |
fi > /dev/null | |
- name: Archive | |
uses: actions/upload-artifact@v4 | |
with: | |
retention-days: 1 | |
path: target/release/* |