Merge pull request #2 from jmarcelomb/dependabot/github_actions/cachi… #27
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: Continuous Integration | |
on: | |
push: | |
paths-ignore: | |
- "**/README.md" | |
pull_request: | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
rust-checks: | |
name: Rust Checks | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
action: | |
- command: build | |
args: --release | |
package: your-life-in-x | |
- command: build | |
args: --release | |
package: simulation | |
- command: build | |
args: --release | |
directory: esp | |
- command: fmt | |
args: --all -- --check --color always | |
- command: clippy | |
directory: esp | |
args: --release --all-features -- -D warnings | |
- command: clippy | |
args: --release --exclude esp --all-features --workspace -- -D warnings | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Cache Nix Store | |
uses: actions/cache@v3 | |
with: | |
path: /nix/store | |
key: nix-${{ runner.os }}-${{ hashFiles('flake.lock') }} | |
restore-keys: | | |
nix-${{ runner.os }}- | |
- name: Install Nix | |
uses: cachix/install-nix-action@v30 | |
with: | |
extra_nix_config: | | |
experimental-features = nix-command flakes | |
keep-outputs = true | |
keep-derivations = true | |
- name: Use Nix shell | |
run: | | |
nix develop --command bash -c ' | |
if [[ -n "${{ matrix.action.package }}" ]]; then | |
cargo ${{ matrix.action.command }} --package ${{ matrix.action.package }} ${{ matrix.action.args }} | |
elif [[ -n "${{ matrix.action.directory }}" ]]; then | |
cd ${{ matrix.action.directory }} && cargo ${{ matrix.action.command }} ${{ matrix.action.args }} | |
else | |
cargo ${{ matrix.action.command }} ${{ matrix.action.args }} | |
fi | |
' |