switch to platform-specific expected values #5
Workflow file for this run
This file contains hidden or 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: Generate Expected Values | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ gen-expected ] | |
| env: | |
| RUST_BACKTRACE: 1 | |
| RUST_LOG: info | |
| jobs: | |
| gen-ubuntu: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Generate expected values | |
| run: GEN_VALS=1 cargo test || true | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ubuntu-testdata | |
| path: testdata/*/linux.csv | |
| gen-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Generate expected values | |
| run: GEN_VALS=1 cargo test || true | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos-testdata | |
| path: testdata/*/macos.csv | |
| commit: | |
| needs: [gen-ubuntu, gen-macos] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: ubuntu-testdata | |
| path: testdata | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: macos-testdata | |
| path: testdata | |
| - name: Show generated files | |
| run: | | |
| echo "=== Generated expected value files ===" | |
| find testdata -name '*.csv' -type f | sort | while read f; do | |
| echo "--- $f ---" | |
| head -3 "$f" | |
| echo "..." | |
| done | |
| - name: Commit testdata | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add testdata/*/linux.csv testdata/*/macos.csv | |
| git status | |
| if git diff --staged --quiet; then | |
| echo "No changes to commit" | |
| else | |
| git commit -m "Regenerate platform-specific expected values" | |
| git push | |
| fi |