Skip to content

Commit

Permalink
test: Split shell and shell-bin to multiple jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
azuwis committed Jan 2, 2024
1 parent cc8708e commit 42826b8
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
shell: [shell, shell-bin]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -44,9 +45,9 @@ jobs:
run: echo "CACHE_TIMESTAMP=$(date +%s)" >> $GITHUB_ENV
- uses: actions/cache/restore@v3
with:
key: pianotrans3-${{ matrix.os }}-${{ hashFiles('flake.*', 'nix/**') }}-${{ env.CACHE_TIMESTAMP }}
key: pianotrans-${{ matrix.os }}-${{ matrix.shell }}-${{ hashFiles('flake.*', 'nix/**') }}-${{ env.CACHE_TIMESTAMP }}
restore-keys: |
pianotrans3-${{ matrix.os }}-${{ hashFiles('flake.*', 'nix/**') }}
pianotrans-${{ matrix.os }}-${{ matrix.shell }}-${{ hashFiles('flake.*', 'nix/**') }}
path: |
/nix/store
/nix/var/nix/db/db.sqlite
Expand All @@ -67,21 +68,15 @@ jobs:
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
with:
limit-access-to-actor: true
- name: Build nix devShells
- name: Build nix devShell
run: |
mkdir -p ~/.local/state/nix/profiles
# build nix devShells, and create profile to prevent gc
echo "Build nix devShell.#shell"
nix --print-build-logs develop .#shell --profile ~/.local/state/nix/profiles/shell --command true
echo "Build nix devShell.#shell-bin"
nix --print-build-logs develop .#shell-bin --profile ~/.local/state/nix/profiles/shell-bin --command true
- name: Test transcribe with nixpkgs#torch
# build nix devShell, and create profile to prevent gc
echo "Build nix devShell"
nix --print-build-logs develop .#${{ matrix.shell }} --profile ~/.local/state/nix/profiles/shell --command true
- name: Test transcribe
run: |
nix --print-build-logs develop .#shell --command ./PianoTrans.py --cli test/cut_liszt.opus test/cut_liszt.opus test/cut_liszt.opus test/cut_liszt.opus test/cut_liszt.opus
test -e test/cut_liszt.opus.mid
- name: Test transcribe with nixpkgs#torch-bin
run: |
nix --print-build-logs develop .#shell-bin --command ./PianoTrans.py --cli test/cut_liszt.opus test/cut_liszt.opus test/cut_liszt.opus test/cut_liszt.opus test/cut_liszt.opus
nix --print-build-logs develop .#${{ matrix.shell }} --command ./PianoTrans.py --cli test/cut_liszt.opus test/cut_liszt.opus test/cut_liszt.opus test/cut_liszt.opus test/cut_liszt.opus
test -e test/cut_liszt.opus.mid
- name: Nix GC
run: |
Expand All @@ -95,7 +90,7 @@ jobs:
- uses: actions/cache/save@v3
if: ${{ env.CACHE_NEED_UPDATE == 'yes' }}
with:
key: pianotrans3-${{ matrix.os }}-${{ hashFiles('flake.*', 'nix/**') }}-${{ env.CACHE_TIMESTAMP }}
key: pianotrans-${{ matrix.os }}-${{ matrix.shell }}-${{ hashFiles('flake.*', 'nix/**') }}-${{ env.CACHE_TIMESTAMP }}
path: |
/nix/store
/nix/var/nix/db/db.sqlite

0 comments on commit 42826b8

Please sign in to comment.