Skip to content

Commit

Permalink
Merge pull request #359 from cfergeau/ghactions
Browse files Browse the repository at this point in the history
test: Use ubuntu runner instead of macos runner for tests
  • Loading branch information
openshift-merge-bot[bot] authored May 17, 2024
2 parents 462b2bd + 923f48c commit 3f7ef77
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 18 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: ["1.20.x", "1.21.x", "1.22.0-rc.1"]
go-version: ["1.20.x", "1.21.x", "1.22.x"]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -38,24 +38,25 @@ jobs:
path: bin/*

tests:
runs-on: macos-latest # Only Mac runners support nested virt
runs-on: ubuntu-latest # The runner must support nested virt
needs: build # Don't bother testing if cross arch build fails
timeout-minutes: 30
steps:
- uses: actions/checkout@v4

- name: Install
- name: Install qemu
run: |
brew install qemu
touch continue
sudo apt install qemu-kvm
sudo usermod -a -G kvm $USER
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.20.x
go-version-file: 'go.mod'

- name: Test
run: make test
run: |
sudo -s -u ${USER} bash -c 'make test'
- uses: actions/upload-artifact@v4
if: always()
Expand All @@ -72,12 +73,12 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.20.x
go-version-file: 'go.mod'

- name: Build
- name: Build
run: make win-sshproxy

- name: Test
- name: Test
run: go test -v .\test-win-sshproxy


5 changes: 2 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.20.x

- uses: actions/checkout@v4
go-version-file: 'go.mod'
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: Build
run: |
Expand Down
16 changes: 11 additions & 5 deletions test/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,23 @@ outer:
})

func qemuExecutable() string {
if runtime.GOOS == "darwin" {
return "qemu-system-x86_64"
qemuBinaries := []string{"qemu-kvm", "qemu-system-x86_64"}
for _, binary := range qemuBinaries {
path, err := exec.LookPath(binary)
if err == nil && path != "" {
return path
}
}
return "qemu-kvm"

return ""
}

func qemuArgs() string {
accel := "kvm"
if runtime.GOOS == "darwin" {
return "-machine q35,accel=hvf:tcg -smp 4 -cpu host"
accel = "hvf"
}
return "-cpu host"
return fmt.Sprintf("-machine q35,accel=%s:tcg -smp 4 -cpu host", accel)
}

func createSSHKeys() (string, error) {
Expand Down

0 comments on commit 3f7ef77

Please sign in to comment.