102 lines (88 loc) · 3.15 KB
/
_test_e2e_regular.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: xxxxx(internal)
on:
workflow_call:
inputs:
scope:
required: true
type: string
packages:
description: Comma-separated package paths to test
type: string
excludePackages:
description: Comma-separated package paths to exclude from testing
type: string
k8sMajor:
default: 1
type: string
k8sMinor:
default: 25
type: string
coverage:
default: false
type: string
forceSkip:
default: false
type: string
defaults:
run:
shell: bash
env:
DEBIAN_FRONTEND: "noninteractive"
WERF_TEST_K8S_DOCKER_REGISTRY_INSECURE: "false"
jobs:
_:
if: inputs.forceSkip == 'false'
runs-on: ubuntu-latest-16-cores
timeout-minutes: 60
steps:
- name: Install system dependencies
run: sudo apt-get install -y libbtrfs-dev buildah qemu-user qemu-user-binfmt
- name: Prepare system for multiarch builds
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: "FIXME: needed for ginkgo to run registry:2 image correctly"
run: |
uname -a
docker version
docker pull registry:2
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
cache: true
go-version-file: go.mod
- name: Install Task
uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up prebuilt werf test binary
uses: ./.github/actions/set-up-prebuilt-werf-test-binary
with:
coverage: ${{ inputs.coverage }}
coverageDirSuffix: ubuntu-22.04
- name: Set up git config
uses: ./.github/actions/set-up-git-config
- name: Install ginkgo
run: task -p deps:install:ginkgo
- name: Test
run: |
source ./scripts/ci/integration_k8s_tests_before_hook.sh
test -n "${{ inputs.packages }}" && paths=paths="$(echo ${{ inputs.packages }} | tr , ' ')"
if ${{ inputs.coverage }}; then
task -p test:e2e:${{ inputs.scope }} $paths -- --coverprofile="$(openssl rand -hex 6)-coverage.out" --keep-going --skip-package '${{ inputs.excludePackages }}'
mv *-coverage.out "$WERF_TEST_COVERAGE_DIR/"
else
task -p test:e2e:${{ inputs.scope }} $paths -- --keep-going --skip-package '${{ inputs.excludePackages }}'
fi
echo loadavg: $(cat /proc/loadavg)
env:
WERF_TEST_K8S_BASE64_KUBECONFIG: ${{ secrets[format('WERF_TEST_K8S_BASE64_KUBECONFIG_{0}_{1}', inputs.k8sMajor, inputs.k8sMinor)] }}
WERF_TEST_K8S_DOCKER_REGISTRY: ${{ secrets.WERF_TEST_K8S_DOCKER_REGISTRY }}
WERF_TEST_K8S_DOCKER_REGISTRY_USERNAME: ${{ secrets.WERF_TEST_K8S_DOCKER_REGISTRY_USERNAME }}
WERF_TEST_K8S_DOCKER_REGISTRY_PASSWORD: ${{ secrets.WERF_TEST_K8S_DOCKER_REGISTRY_PASSWORD }}
- if: inputs.coverage == 'true'
name: Upload coverage artifact
uses: actions/upload-artifact@master
with:
name: coverage
path: coverage