Skip to content

Commit

Permalink
ci: Pin k3d to use rancher/k3s:v1.21.7-k3s1 (#2207)
Browse files Browse the repository at this point in the history
Signed-off-by: David Farr <david_farr@intuit.com>
  • Loading branch information
dfarr committed Oct 1, 2022
1 parent 2860cd5 commit e99ab51
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 47 deletions.
91 changes: 46 additions & 45 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Restore go build cache
uses: actions/cache@v3
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-v1-${{ hashFiles('**/go.mod') }}
- name: Setup Golang
uses: actions/setup-go@v3.2.0
with:
go-version: "1.19"
- name: Add bins to PATH
run: |
echo /home/runner/go/bin >> $GITHUB_PATH
echo /usr/local/bin >> $GITHUB_PATH
- name: Restore go build cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install protoc
run: |
set -eux -o pipefail
Expand All @@ -52,9 +52,7 @@ jobs:
- name: Get dependencies
run: go mod download
- name: Make codegen
run: |
echo 'GOPATH=/home/runner/go' >> $GITHUB_ENV
make -B codegen
run: make -B codegen
- name: Ensure nothing changed
run: git diff --exit-code

Expand All @@ -63,21 +61,24 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Set up Go 1.x
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Golang
uses: actions/setup-go@v3.2.0
with:
go-version: "1.19"
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Restore Go build cache
- name: Restore go build cache
uses: actions/cache@v3
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
run: go mod download
- name: Test
- name: Run tests
run: make test

lint:
Expand All @@ -87,23 +88,30 @@ jobs:
env:
GOPATH: /home/runner/go
steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Golang
uses: actions/setup-go@v3.2.0
with:
go-version: "1.19"
- name: Restore Go build cache
- name: Restore go build cache
uses: actions/cache@v3
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: make lint
- run: git diff --exit-code

e2e-tests:
name: E2E Tests
runs-on: ubuntu-latest
timeout-minutes: 20
env:
KUBECONFIG: /home/runner/.kubeconfig
strategy:
fail-fast: false
max-parallel: 4
Expand All @@ -114,34 +122,27 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Restore go build cache
uses: actions/cache@v3
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-v2-${{ hashFiles('**/go.mod') }}
- name: Setup Golang
uses: actions/setup-go@v3.2.0
with:
go-version: "1.19"
- name: Add bins to PATH
run: |
echo /home/runner/go/bin >> $GITHUB_PATH
echo /usr/local/bin >> $GITHUB_PATH
- name: Restore go build cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install k3d
run: curl -sfL https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash &
- name: Create a registry and a cluster
- name: Create k3d registry and cluster
run: |
k3d registry create e2e-registry --port 5111
k3d cluster create e2e --registry-use k3d-e2e-registry:5111
k3d kubeconfig get e2e > ~/.kube/argo-events-e2e-config
k3d cluster create e2e -i rancher/k3s:v1.21.7-k3s1 --registry-use k3d-e2e-registry:5111
echo '127.0.0.1 k3d-e2e-registry' | sudo tee -a /etc/hosts
- name: Install Argo Events
env:
GOPATH: /home/runner/go
run: |
KUBECONFIG=~/.kube/argo-events-e2e-config IMAGE_NAMESPACE=k3d-e2e-registry:5111 VERSION=${{ github.sha }} DOCKER_PUSH=true make start
- name: Run tests
env:
GOPATH: /home/runner/go
run: KUBECONFIG=~/.kube/argo-events-e2e-config EventBusDriver=${{matrix.driver}} make test-functional

run: |
IMAGE_NAMESPACE=k3d-e2e-registry:5111 VERSION=${{ github.sha }} DOCKER_PUSH=true make start
EventBusDriver=${{ matrix.driver }} make test-functional
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ test:
go test $(shell go list ./... | grep -v /vendor/ | grep -v /test/e2e/) -race -short -v

test-functional:
go test -v -timeout 10m -count 1 --tags functional -p 1 ./test/e2e
go test -v -timeout 15m -count 1 --tags functional -p 1 ./test/e2e

# to run just one of the functional e2e tests by name (i.e. 'make TestMetricsWithWebhook'):
Test%:
Expand Down
2 changes: 1 addition & 1 deletion webhook/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func fakeOptions() Options {
DeploymentName: "events-webhook",
ClusterRoleName: "argo-events-webhook",
ServiceName: "webhook",
Port: 443,
Port: 8443,
SecretName: "webhook-certs",
WebhookName: "webhook.argo-events.argoproj.io",
}
Expand Down

0 comments on commit e99ab51

Please sign in to comment.