Merge pull request #405 from crc-org/dependabot/go_modules/github.com… #1119
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: Build | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| tags: | |
| - "*" | |
| pull_request: {} | |
| jobs: | |
| golangci: | |
| name: lint | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: golangci-lint | |
| run: make lint | |
| build: | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Test matrix covers multiple macOS versions and architectures: | |
| # - macos-15-intel: x86_64 runner, supports virtualization for integration tests | |
| # - macos-14: arm64 (Apple Silicon) runner, unit tests only | |
| # - macos-15: arm64 (Apple Silicon) runner, unit tests | |
| # - macos-26: arm64 (Apple Silicon) runner, unit tests + artifact upload | |
| runner: | |
| - macos-15-intel | |
| - macos-14 | |
| - macos-15 | |
| - macos-26 | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: >- | |
| WORKAROUND: Fetch tags that points to the revisions | |
| checked-out(actions/checkout#1467) | |
| run: |- | |
| git fetch --tags --force | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Build | |
| run: make | |
| - name: Install qemu-img | |
| run: | | |
| brew update | |
| brew install qemu | |
| - name: Verify qemu-img is installed | |
| run: qemu-img --version | |
| - name: Unit tests | |
| run: make test-unit | |
| # Workaround: TestSSHAccess/tcp fails on the first attempt on macos-15-intel with: | |
| # "timeout waiting for SSH: dial tcp 192.168.65.2:22: connect: no route to host" | |
| # but succeeds on subsequent runs. Run it once with continue-on-error to prepare | |
| # the environment before integration tests. | |
| - name: Workaround for network issue | |
| if: matrix.runner == 'macos-15-intel' | |
| run: |- | |
| go test -run TestSSHAccess/tcp ./test | |
| continue-on-error: true | |
| # Integration tests run only on macos-15-intel due to virtualization requirements | |
| # macos-15-intel runners will be deprecated by August 2027 | |
| # See:https://github.com/actions/runner-images/issues/13045 | |
| - name: Integration tests (macos-15-intel) | |
| if: matrix.runner == 'macos-15-intel' | |
| run: make test-integration | |
| - name: vet | |
| run: go vet ./... | |
| - name: Upload vfkit artifact (macos-26) | |
| if: matrix.runner == 'macos-26' | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: Unsigned vfkit Universal Binary | |
| path: "./out/vfkit" | |
| if-no-files-found: error |