Fix Await to process Go-scheduled jobs instead of blocking in js_std_loop #859
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: Test | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request_target: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: ${{ matrix.os }} @ Go ${{ matrix.go }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| go: ['stable'] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout PR code | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| - name: Build | |
| run: go build -v ./... | |
| # Linux and macOS test step | |
| - name: Test with coverage (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| go test -v -race -coverprofile=coverage.out -covermode=atomic ./... | |
| # Windows test step (separate to handle PowerShell issues) | |
| - name: Test with coverage (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| go test -v -race -coverprofile=coverage.out -covermode=atomic ./... | |
| shell: cmd | |
| # Alternative Windows approach using PowerShell with proper escaping | |
| # - name: Test with coverage (Windows PowerShell) | |
| # if: runner.os == 'Windows' | |
| # run: | | |
| # go test -v -race "-coverprofile=coverage.out" "-covermode=atomic" ./... | |
| # shell: pwsh | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5.5.2 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| files: ./coverage.out | |
| flags: ${{ matrix.os }}-go${{ matrix.go }} | |
| name: codecov-${{ matrix.os }}-go${{ matrix.go }} | |
| fail_ci_if_error: true | |
| verbose: true | |