simulate(tui): refresh summary before writing the run report #1035
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: Go Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| # No windows-latest: its native MinGW GCC can't compile the WebRTC APM | |
| # C++ (clang-only SEH __try/__except). Windows is built+validated by the | |
| # zig cross-build in build.yaml; the audio packages have no unit tests. | |
| os: [ubuntu-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: read | |
| packages: read | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| # pkg/portaudio/pa_src is a submodule with the vendored PortAudio C | |
| # source; needed now that console (cgo) builds unconditionally. | |
| submodules: true | |
| - name: Install ALSA headers (Linux) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: sudo apt-get update && sudo apt-get install -y libasound2-dev | |
| - name: Set up Go | |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Download Go modules | |
| run: go mod download | |
| - name: Lint | |
| uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9 | |
| with: | |
| version: v2.11.4 | |
| - name: Test | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| go test -race -json -v ./... 2>&1 | tee test.log | |
| - name: Verify fish_autocomplete is up to date | |
| if: matrix.os == 'ubuntu-latest' | |
| shell: bash | |
| run: | | |
| go build -o /tmp/lk ./cmd/lk | |
| /tmp/lk generate-fish-completion -o /tmp/fish_autocomplete.fresh | |
| if ! diff -u autocomplete/fish_autocomplete /tmp/fish_autocomplete.fresh; then | |
| echo "::error::autocomplete/fish_autocomplete is stale; regenerate with:" | |
| echo " go build -o /tmp/lk ./cmd/lk && /tmp/lk generate-fish-completion -o autocomplete/fish_autocomplete" | |
| exit 1 | |
| fi | |
| - name: Upload test log | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 | |
| if: always() | |
| with: | |
| name: test-log-${{ matrix.os }} | |
| path: test.log | |
| if-no-files-found: warn |