-
Notifications
You must be signed in to change notification settings - Fork 10
111 lines (111 loc) · 3.49 KB
/
ci.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: CI
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
workflow_dispatch:
env:
GO_VERSION: '1.23.0'
GOLANGCI_LINT_VERSION: '1.60.3'
jobs:
git-secrets:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Pull latest awslabs/git-secrets repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: awslabs/git-secrets
ref: 1.3.0
fetch-tags: true
path: git-secrets
- name: Install git secrets from source
run: sudo make install
working-directory: git-secrets
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Scan repository for git secrets
run: |
git secrets --register-aws
git secrets --scan-history
lint:
runs-on: ubuntu-latest
strategy:
matrix:
working_dir: ['.']
timeout-minutes: 10
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: golangci/golangci-lint-action@v6 # v6.1.0
with:
version: v${{ env.GOLANGCI_LINT_VERSION }}
working-directory: ${{ matrix.working_dir }}
args: --fix=false --timeout=5m
yamllint:
name: yamllint-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- run: yamllint .
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout finch-deamon repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Build the daemon
run: make build
- name: Run unit tests
run: make test-unit
- name: Create build artifacts
run: tar -cvf build-artifacts.tar bin/
- name: Upload build artifacts
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: build-artifacts
path: build-artifacts.tar
e2e-test:
runs-on: ubuntu-latest
needs: [build]
strategy:
matrix:
containerd: ["1.7.22", "2.0.0"]
fail-fast: false
timeout-minutes: 10
env:
CONTAINERD_VERSION: ${{ matrix.containerd }}
steps:
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout finch-daemon repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Stop pre-existing containerd and docker services
run: |
sudo systemctl stop docker
sudo systemctl stop containerd
- name: Install Dependencies for e2e Testing
run: ./setup-test-env.sh
- name: Download build artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: build-artifacts
- name: Extract build artifacts
run: tar -xvf build-artifacts.tar
- name: Remove default podman network config
run: |
sudo ls /etc/cni/net.d
sudo rm /etc/cni/net.d/87-podman-bridge.conflist
- name: Start finch-daemon
run: sudo bin/finch-daemon --debug --socket-owner $UID &
- name: Run e2e test
run: sudo make test-e2e