Skip to content

Commit 27ad129

Browse files
mumoshuSajfer
authored andcommitted
Add an experimental GitHub Actions workflow for CI
All the credits goes to @itscaro's work at roboll/helmfile#2084. The only change I made is related to the main branch rename.
1 parent 46f1cd7 commit 27ad129

File tree

1 file changed

+98
-0
lines changed

1 file changed

+98
-0
lines changed

.github/workflows/ci.yaml

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
11+
tests:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Cache libraries
16+
uses: actions/cache@v2
17+
env:
18+
cache-name: cache-go
19+
with:
20+
path: ~/go/pkg/mod
21+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }}
22+
restore-keys: |
23+
${{ runner.os }}-build-${{ env.cache-name }}-
24+
${{ runner.os }}-build-
25+
${{ runner.os }}-
26+
- name: Set up Go
27+
uses: actions/setup-go@v2
28+
with:
29+
go-version: 1.17
30+
- name: Env
31+
run: go env
32+
- name: Build
33+
run: make build build-test-tools
34+
- name: Test
35+
run: make check pristine test
36+
37+
- name: Prepare tar to upload built binaries
38+
run: tar -cvf built-binaries.tar helmfile diff-yamls yamldiff
39+
- name: Upload built binaries
40+
uses: actions/upload-artifact@v2
41+
with:
42+
name: built-binaries-${{ github.run_id }}
43+
path: built-binaries.tar
44+
retention-days: 1
45+
- name: Display built binaries
46+
run: ls -l helmfile diff-yamls yamldiff
47+
48+
integration_tests:
49+
needs: tests
50+
runs-on: ubuntu-latest
51+
strategy:
52+
matrix:
53+
include:
54+
- helm-version: v3.4.2
55+
- helm-version: v3.5.4
56+
- helm-version: v3.6.3
57+
- helm-version: v3.7.2
58+
- helm-version: v3.8.0
59+
steps:
60+
- uses: actions/checkout@v2
61+
- name: Cache libraries
62+
uses: actions/cache@v2
63+
env:
64+
cache-name: cache-go
65+
with:
66+
path: ~/go/pkg/mod
67+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }}
68+
restore-keys: |
69+
${{ runner.os }}-build-${{ env.cache-name }}-
70+
${{ runner.os }}-build-
71+
${{ runner.os }}-
72+
- name: Set up Go
73+
uses: actions/setup-go@v2
74+
with:
75+
go-version: 1.17
76+
- name: Env
77+
run: go env
78+
79+
- name: Download built binaries
80+
uses: actions/download-artifact@v2
81+
with:
82+
name: built-binaries-${{ github.run_id }}
83+
- name: Extract tar to get built binaries
84+
run: tar -xvf built-binaries.tar
85+
- name: Display built binaries
86+
run: ls -l helmfile diff-yamls yamldiff
87+
88+
- name: Install test dependencies
89+
env:
90+
HELM_VERSION: ${{ matrix.helm-version }}
91+
run: make -C .circleci helm vault sops kustomize
92+
- name: Start minikube
93+
uses: medyagh/setup-minikube@master
94+
- name: Execute integration tests
95+
env:
96+
HELMFILE_HELM3: 1
97+
TERM: xterm
98+
run: make integration

0 commit comments

Comments
 (0)