Update workflow to use self-hosted runners #2
This file contains 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: E2E Tests | |
on: | |
push: | |
branches: | |
- 'master' | |
- 'release-*' | |
pull_request: | |
branches: | |
- 'master' | |
- 'release-*' | |
jobs: | |
test-e2e: | |
name: Run end-to-end tests | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup k3s | |
run: | | |
curl -sfL https://get.k3s.io | sh - | |
sudo mkdir ~/.kube | |
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config | |
sudo chmod 755 ~/.kube/config | |
kubectl version | |
- uses: actions/cache@v2 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Download cache | |
run: go mod download | |
- name: Install CRDs | |
run: | | |
kubectl apply -k manifests/crds | |
kubectl apply -f test/e2e/crds | |
- name: Start controller | |
run: make start-e2e 2>&1 | sed -r "s/[[:cntrl:]]\[[0-9]{1,3}m//g" > /tmp/e2e-controller.log & | |
- name: Run e2e tests | |
run: make test-e2e | |
- name: Upload e2e-controller logs | |
uses: actions/upload-artifact@v2 | |
with: | |
name: e2e-controller-k8s.log | |
path: /tmp/e2e-controller.log | |
if: ${{ failure() }} |