-
Notifications
You must be signed in to change notification settings - Fork 1.4k
56 lines (46 loc) · 1.87 KB
/
test-sample-ci.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
name: Test Sample CI
on:
push:
pull_request:
jobs:
check-ci:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install act in project bin
run: |
mkdir -p testdata/project-v4/bin
ACT_VERSION="v0.2.65" # Replace with the latest version
curl -Lo act.tgz https://github.com/nektos/act/releases/download/${ACT_VERSION}/act_Linux_x86_64.tar.gz
tar -C testdata/project-v4/bin -xzf act.tgz act
rm -f act.tgz
- name: Test act installation
run: |
echo "Testing act installation"
testdata/project-v4/bin/act --help
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
- name: Prepare the environment
run: |
KUSTOMIZATION_FILE_PATH="testdata/project-v4/config/default/kustomization.yaml"
sed -i '25s/^#//' $KUSTOMIZATION_FILE_PATH
sed -i '51s/^#//' $KUSTOMIZATION_FILE_PATH
cd testdata/project-v4/
go mod tidy
make generate
make manifests
- name: Lint
run: |
echo "Running lint ci"
./testdata/project-v4/bin/act -W /testdata/project-v4/.github/workflows/lint.yml --default --container-architecture linux/amd64 --image nektos/act-environments-ubuntu:medium
- name: Unit Tests
run: |
echo "Running unit tests ci"
./testdata/project-v4/bin/act -W /testdata/project-v4/.github/workflows/test.yml --default --container-architecture linux/amd64 --image nektos/act-environments-ubuntu:medium
- name: E2e Tests
run: |
echo "Running e2e tests ci"
./testdata/project-v4/bin/act -W /testdata/project-v4/.github/workflows/test-e2e.yml --default --container-architecture linux/amd64 --image nektos/act-environments-ubuntu:medium