-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (82 loc) · 2.7 KB
/
build.yaml
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
name: Build
concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
on:
pull_request: {}
push:
branches:
- main
env:
SMOKE_PRODUCT_NAME: "kuma"
SMOKE_PRODUCT_VERSION: "2.9.2"
CI_TOOLS_DIR: "/home/runner/work/kuma-smoke/.ci_tools"
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: make dev/tools
run: make dev/tools
- name: make check
run: make check
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout=10m --verbose
skip-cache: true
build-test:
name: Build and test
timeout-minutes: 40
needs:
- check
runs-on: ubuntu-latest
strategy:
matrix:
envPlatform: ${{ fromJSON( (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) && '["kind", "gke"]' || '["kind"]' ) }}
fail-fast: false
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci/skip-test') }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: make dev/tools
run: |
make dev/tools
echo "${CI_TOOLS_DIR}/bin" >> $GITHUB_PATH
- name: make build
run: make build
- name: export gke values
if: ${{ matrix.envPlatform == 'gke' && secrets.GOOGLE_PROJECT != '' }}
run: |
echo 'GOOGLE_PROJECT="${{ secrets.GOOGLE_PROJECT }}" >> $GITHUB_ENV
echo GOOGLE_LOCATION="${{ secrets.GOOGLE_LOCATION }}" >> $GITHUB_ENV
echo "GOOGLE_APPLICATION_CREDENTIALS<<EOF" >> $GITHUB_ENV
echo '${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}' >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: make run
if: ${{ matrix.envPlatform != 'gke' || secrets.GOOGLE_PROJECT != '' }}
run: |
SMOKE_ENV_TYPE=${{ matrix.envPlatform }} make run
- name: make cleanup
if: always()
run: make cleanup
- uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
if: always()
with:
name: smoke-report-${{ matrix.envPlatform }}
if-no-files-found: ignore
path: |
raw-report.json
build/debug-output/*.log
retention-days: ${{ github.event_name == 'pull_request' && 7 || 15 }}