k3s/.github/workflows/integration.yaml
Jacob Blain Christen c77efe64e1
tests/vagrant: refactor vagrant smoke tests (#4484)
- updated `tests/TESTING.md`
- cgroup, snapshotter, and install tests all under tests/vagrant
- cgroup and snapshotter workflows trigger for all code changes on all branches (excluding markdown docs, install script, and other vagrant tests)
- install workflow triggers for relevant script and fixture changes, only on master or pull-requests that target it
- integration and unit test workflows should not trigger for install script changes nor anything under tests/vagrant

Signed-off-by: Jacob Blain Christen <jacob@rancher.com>
2021-11-15 11:50:38 -07:00

73 lines
1.9 KiB
YAML

name: Integration Test Coverage
on:
push:
paths-ignore:
- "**.md"
- "channel.yaml"
- "install.sh"
- "tests/vagrant/**"
- ".github/**"
- "!.github/workflows/integration.yaml"
pull_request:
paths-ignore:
- "**.md"
- "channel.yaml"
- "install.sh"
- "tests/vagrant/**"
- ".github/**"
- "!.github/workflows/integration.yaml"
workflow_dispatch: {}
jobs:
build:
name: Build
runs-on: ubuntu-20.04
timeout-minutes: 20
steps:
- name: "Checkout"
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: "Make"
run: DOCKER_BUILDKIT=1 SKIP_VALIDATE=1 make
- name: "Upload k3s binary"
uses: actions/upload-artifact@v2
with:
name: k3s
path: dist/artifacts/k3s
test:
needs: build
name: Integration Tests
runs-on: ubuntu-20.04
timeout-minutes: 30
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '1.16.5'
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: "Download k3s binary"
uses: actions/download-artifact@v2
with:
name: k3s
path: ./dist/artifacts
- name: Run Integration Tests
run: |
chmod +x ./dist/artifacts/k3s
go test -coverpkg=./... -coverprofile=coverage.out ./pkg/... -run Integration
go tool cover -func coverage.out
# these tests do not relate to coverage and must be run separately
go test ./tests/integration/... -run Integration
- name: On Failure, Launch Debug Session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 5
- name: Upload Results To Codecov
uses: codecov/codecov-action@v1
with:
files: ./coverage.out
flags: inttests # optional
verbose: true # optional (default = false)