Generate Expected Values #8
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: apvd-core/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: apvd-core/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: apvd-core/testdata | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: macos-testdata | |
| path: apvd-core/testdata | |
| - name: Show generated files | |
| run: | | |
| echo "=== Generated expected value files ===" | |
| find apvd-core/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 apvd-core/testdata/*/linux.csv apvd-core/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 |