feat(ci): try github actions #4
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: GitHub Actions Demo | |
on: [push] | |
# env: | |
# CARGO_HOME: "${CI_PROJECT_DIR}/.cargo" # necessary for dependency caching | |
# default: | |
# cache: | |
# key: "$CI_JOB_NAME" # not using Cargo.lock as key file: it changes too often | |
# paths: [ .cargo/ ] | |
# unprotect: true # publish job is "protected" because it runs only on main | |
defaults: | |
run: | |
working-directory: ./.github/ci-tools | |
jobs: | |
format: | |
runs-on: rust-1.82 | |
# NOTE: Rust compiler versions are backward compatible, but updated clippy | |
# can block a previously working job, pinning version to grant more reproducibility | |
steps: | |
- name: Check formatting | |
run: ./format | |
# cache: [] | |
semver: | |
runs-on: rust-1.82 | |
if: github.ref == 'refs/heads/master' # only on `master` branch | |
steps: | |
- name: Check semver | |
run: ./semver | |
test: | |
runs-on: rust-1.82 | |
steps: | |
- name: Run tests | |
run: ./test | |
# not splitting lint (clippy) and test in two jobs to avoid wasting environment preparation time |