Skip to content

Commit

Permalink
ci: support merge queue (#3652)
Browse files Browse the repository at this point in the history
  • Loading branch information
knqyf263 committed Jun 12, 2023
1 parent 9e6411e commit a4f27d2
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 144 deletions.
133 changes: 133 additions & 0 deletions .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: Integration Test
on:
push:
branches:
- main
paths-ignore:
- '**.md'
- 'docs/**'
- 'mkdocs.yml'
- 'LICENSE'
pull_request:
paths-ignore:
- '**.md'
- 'docs/**'
- 'mkdocs.yml'
- 'LICENSE'
merge_group:
jobs:
integration:
name: Integration Test
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod

- name: Install tools
uses: aquaproj/aqua-installer@v2.1.1
with:
aqua_version: v1.25.0

- name: Run integration tests
run: mage test:integration

k8s-integration:
name: K8s Integration Test
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod

- name: Install tools
uses: aquaproj/aqua-installer@v2.1.1
with:
aqua_version: v1.25.0

- name: Run k8s integration tests
run: mage test:k8s

module-test:
name: Module Integration Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod

- name: Install tools
uses: aquaproj/aqua-installer@v2.1.1
with:
aqua_version: v1.25.0

- name: Run module integration tests
shell: bash
run: |
mage test:module
vm-test:
name: VM Integration Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Install tools
uses: aquaproj/aqua-installer@v2.1.1
with:
aqua_version: v1.25.0
- name: Run vm integration tests
run: |
mage test:vm
build-test:
name: Build Test
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod

- name: Determine GoReleaser ID
id: goreleaser_id
shell: bash
run: |
if [ "${{ matrix.operating-system }}" == "windows-latest" ]; then
echo "id=--id build-windows" >> $GITHUB_OUTPUT
elif [ "${{ matrix.operating-system }}" == "macos-latest" ]; then
echo "id=--id build-macos --id build-bsd" >> $GITHUB_OUTPUT
else
echo "id=--id build-linux" >> $GITHUB_OUTPUT
fi
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: v1.16.2
args: build --snapshot --clean --timeout 90m ${{ steps.goreleaser_id.outputs.id }}
110 changes: 2 additions & 108 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,8 @@ on:
push:
branches:
- main
paths-ignore:
- '**.md'
- 'docs/**'
- 'mkdocs.yml'
- 'LICENSE'
pull_request:
paths-ignore:
- '**.md'
- 'docs/**'
- 'mkdocs.yml'
- 'LICENSE'
merge_group:
jobs:
test:
name: Test
Expand Down Expand Up @@ -62,101 +53,4 @@ jobs:
if: matrix.operating-system == 'ubuntu-latest'

- name: Run unit tests
run: mage test:unit

integration:
name: Integration Test
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod

- name: Install tools
uses: aquaproj/aqua-installer@v2.1.1
with:
aqua_version: v1.25.0

- name: Run integration tests
run: mage test:integration

k8s-integration:
name: K8s Integration Test
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod

- name: Install tools
uses: aquaproj/aqua-installer@v2.1.1
with:
aqua_version: v1.25.0

- name: Run k8s integration tests
run: mage test:k8s

module-test:
name: Module Integration Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod

- name: Install tools
uses: aquaproj/aqua-installer@v2.1.1
with:
aqua_version: v1.25.0

- name: Run module integration tests
shell: bash
run: |
mage test:module
build-test:
name: Build Test
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod

- name: Determine GoReleaser ID
id: goreleaser_id
shell: bash
run: |
if [ "${{ matrix.operating-system }}" == "windows-latest" ]; then
echo "id=--id build-windows" >> $GITHUB_OUTPUT
elif [ "${{ matrix.operating-system }}" == "macos-latest" ]; then
echo "id=--id build-macos --id build-bsd" >> $GITHUB_OUTPUT
else
echo "id=--id build-linux" >> $GITHUB_OUTPUT
fi
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: v1.16.2
args: build --snapshot --clean --timeout 90m ${{ steps.goreleaser_id.outputs.id }}
run: mage test:unit
36 changes: 0 additions & 36 deletions .github/workflows/vm-test.yaml

This file was deleted.

0 comments on commit a4f27d2

Please sign in to comment.