Skip to content

CI/test: Display transcribe time in summary #197

CI/test: Display transcribe time in summary

CI/test: Display transcribe time in summary #197

Workflow file for this run

name: Test
permissions: {}
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-12, macos-latest, all]
jobs:
transcribe:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-12, macos-latest]
shell: [shell]
include:
# error: triton-2.1.0 not supported for interpreter python3.12
# re-enable after https://github.com/NixOS/nixpkgs/pull/328247 merged
# - {os: ubuntu-latest, shell: shell-bin}
- {os: ubuntu-latest, shell: shell-cuda}
- {os: ubuntu-latest, shell: shell-mkl}
runs-on: ${{ matrix.os }}
steps:
- name: Skip debug
if: >-
${{ github.event_name == 'workflow_dispatch' && inputs.debug && !
((inputs.os == 'all' || inputs.os == matrix.os) && matrix.shell == 'shell')
}}
run: exit 1
- uses: actions/checkout@v4
- uses: azuwis/actions/nix@main
with:
key: nix-${{ matrix.shell }}
debug: ${{ github.event_name == 'workflow_dispatch' && inputs.debug }}
- uses: cachix/cachix-action@v15
with:
name: azuwis
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: nix-community
# 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 | tee /tmp/transcribe.log
time=$(awk 'BEGIN {ORS=" "} /Transcribe time:/ {print $3}' /tmp/transcribe.log)
echo "${{ matrix.os }}-${{ matrix.shell }}: $time" >> $GITHUB_STEP_SUMMARY
test -e test/cut_liszt.opus.mid
- uses: azuwis/actions/nix/post@main