2021-07-26 16:59:33 +00:00
|
|
|
name: Integration Test Coverage
|
|
|
|
on:
|
|
|
|
push:
|
2021-10-29 16:47:37 +00:00
|
|
|
paths-ignore:
|
2021-07-26 16:59:33 +00:00
|
|
|
- "**.md"
|
2021-11-15 18:50:38 +00:00
|
|
|
- "channel.yaml"
|
2021-10-29 16:47:37 +00:00
|
|
|
- "install.sh"
|
2022-10-06 19:27:44 +00:00
|
|
|
- "tests/**"
|
|
|
|
- "!tests/integration**"
|
2021-11-15 18:50:38 +00:00
|
|
|
- ".github/**"
|
|
|
|
- "!.github/workflows/integration.yaml"
|
2021-07-26 16:59:33 +00:00
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- "**.md"
|
2021-11-15 18:50:38 +00:00
|
|
|
- "channel.yaml"
|
2021-10-29 16:47:37 +00:00
|
|
|
- "install.sh"
|
2022-10-06 19:27:44 +00:00
|
|
|
- "tests/**"
|
|
|
|
- "!tests/integration**"
|
2023-06-08 15:49:11 +00:00
|
|
|
- "!tests/e2e**"
|
2021-11-15 18:50:38 +00:00
|
|
|
- ".github/**"
|
|
|
|
- "!.github/workflows/integration.yaml"
|
2021-08-27 06:40:06 +00:00
|
|
|
workflow_dispatch: {}
|
2023-01-12 21:57:57 +00:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
2023-05-08 19:46:51 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
GOCOVERDIR: /tmp/k3scov
|
2023-01-12 21:57:57 +00:00
|
|
|
|
2021-07-26 16:59:33 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
2022-10-06 19:27:44 +00:00
|
|
|
uses: ./.github/workflows/build-k3s.yaml
|
2021-07-26 16:59:33 +00:00
|
|
|
test:
|
|
|
|
needs: build
|
|
|
|
name: Integration Tests
|
|
|
|
runs-on: ubuntu-20.04
|
2023-08-07 21:04:04 +00:00
|
|
|
timeout-minutes: 45
|
2023-08-10 20:55:30 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
itest: [certrotation, etcdrestore, localstorage, startup, custometcdargs, etcdsnapshot, kubeflags, longhorn, secretsencryption]
|
|
|
|
max-parallel: 3
|
2021-07-26 16:59:33 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-26 12:46:37 +00:00
|
|
|
uses: actions/checkout@v4
|
2021-07-26 16:59:33 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
2022-10-06 17:50:46 +00:00
|
|
|
- name: Install Go
|
2024-01-02 16:04:25 +00:00
|
|
|
uses: actions/setup-go@v5
|
2022-10-06 17:50:46 +00:00
|
|
|
with:
|
2024-01-18 13:15:18 +00:00
|
|
|
go-version: '1.21.6'
|
2022-10-06 17:50:46 +00:00
|
|
|
check-latest: true
|
|
|
|
cache: true
|
|
|
|
cache-dependency-path: |
|
|
|
|
**/go.sum
|
|
|
|
**/go.mod
|
2021-07-26 16:59:33 +00:00
|
|
|
- name: "Download k3s binary"
|
2023-01-17 19:04:34 +00:00
|
|
|
uses: actions/download-artifact@v3
|
2021-07-26 16:59:33 +00:00
|
|
|
with:
|
|
|
|
name: k3s
|
|
|
|
path: ./dist/artifacts
|
|
|
|
- name: Run Integration Tests
|
|
|
|
run: |
|
|
|
|
chmod +x ./dist/artifacts/k3s
|
2023-05-08 19:46:51 +00:00
|
|
|
mkdir -p $GOCOVERDIR
|
2023-08-10 20:55:30 +00:00
|
|
|
sudo -E env "PATH=$PATH" go test -v -timeout=45m ./tests/integration/${{ matrix.itest }}/... -run Integration
|
2021-07-26 16:59:33 +00:00
|
|
|
- name: On Failure, Launch Debug Session
|
|
|
|
if: ${{ failure() }}
|
|
|
|
uses: mxschmitt/action-tmate@v3
|
2021-12-01 21:14:59 +00:00
|
|
|
timeout-minutes: 5
|
2023-05-08 19:46:51 +00:00
|
|
|
- name: Generate coverage report
|
2023-08-10 20:55:30 +00:00
|
|
|
run: go tool covdata textfmt -i $GOCOVERDIR -o ${{ matrix.itest }}.out
|
2023-05-08 19:46:51 +00:00
|
|
|
- name: Upload Results To Codecov
|
2024-02-07 00:33:59 +00:00
|
|
|
uses: codecov/codecov-action@v4
|
2023-05-08 19:46:51 +00:00
|
|
|
with:
|
2023-08-10 20:55:30 +00:00
|
|
|
files: ./${{ matrix.itest }}.out
|
2023-05-08 19:46:51 +00:00
|
|
|
flags: inttests # optional
|
2023-08-22 21:09:31 +00:00
|
|
|
verbose: true # optional (default = false)
|