test: Use cachix/cachix-action@main #155
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: Test | |
on: | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- 'screenshots/**' | |
- 'windows/**' | |
push: | |
paths-ignore: | |
- '**.md' | |
- 'screenshots/**' | |
- 'windows/**' | |
workflow_dispatch: | |
inputs: | |
debug: | |
description: Enable debug | |
type: boolean | |
required: false | |
default: false | |
os: | |
description: Debug OS | |
required: true | |
type: choice | |
options: [ubuntu-latest, macos-latest, all] | |
jobs: | |
transcribe: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
shell: [shell, shell-bin] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: azuwis/nix-action@main | |
with: | |
key: pianotrans-${{ matrix.shell }}-${{ hashFiles('flake.*', 'nix/**') }} | |
debug: >- | |
${{ github.event_name == 'workflow_dispatch' | |
&& inputs.debug | |
&& matrix.shell == 'shell' | |
&& (inputs.os == 'all'|| inputs.os == matrix.os) | |
}} | |
credential: ${{ secrets.TTYD_CREDENTIAL }} | |
- uses: cachix/cachix-action@main | |
with: | |
name: azuwis | |
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
pushFilter: (-source$|\.whl$) | |
- name: Build nix devShell | |
run: | | |
# build nix devShell, and create profile to prevent gc | |
echo "Build nix devShell" | |
nix -L develop .#${{ matrix.shell }} --profile ~/.local/state/nix/profiles/shell --command true | |
- name: Test transcribe | |
run: | | |
nix -L develop .#${{ matrix.shell }} --command ./PianoTrans.py --cli test/cut_liszt.opus test/cut_liszt.opus test/cut_liszt.opus | |
test -e test/cut_liszt.opus.mid | |
- uses: azuwis/nix-action@post |