Skip to content

Commit c5f2dc4

Browse files
committed
Migrate to GH actions
1 parent 7486472 commit c5f2dc4

File tree

4 files changed

+141
-23
lines changed

4 files changed

+141
-23
lines changed

.circleci/config.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*.sh]
4+
indent_style = space
5+
indent_size = 2
6+
max_line_length = 120
7+
trim_trailing_whitespace = true
8+
shell_variant = posix

.github/workflows/ci.yaml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
---
2+
name: CI
3+
4+
env:
5+
VERSION_GO: '1.17.5'
6+
VERSION_HELM: 'v3.7.0'
7+
8+
on:
9+
pull_request:
10+
push:
11+
branches:
12+
- master
13+
14+
jobs:
15+
build:
16+
name: "Build & Test"
17+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v2
21+
- uses: actions/setup-go@v2
22+
with:
23+
go-version: ${{ env.VERSION_GO }}
24+
25+
- uses: actions/cache@v2
26+
with:
27+
path: ~/go/pkg/mod
28+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
29+
restore-keys: |
30+
${{ runner.os }}-go-
31+
32+
- name: Install dependencies
33+
run: make bootstrap
34+
35+
- name: Run unit tests
36+
run: make test
37+
38+
- name: Verify installation
39+
run: |
40+
mkdir -p helmhome
41+
make install HELM_HOME=helmhome
42+
helmhome/plugins/helm-diff/bin/diff version
43+
44+
helm-install:
45+
name: helm install
46+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
47+
needs: [build]
48+
runs-on: ${{ matrix.os }}
49+
continue-on-error: ${{ matrix.experimental }}
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
os: [ubuntu-latest, macos-latest, windows-latest]
54+
shell: [ default ]
55+
experimental: [ false ]
56+
include:
57+
- os: windows-latest
58+
shell: wsl
59+
experimental: false
60+
- os: windows-latest
61+
shell: cygwin
62+
experimental: true
63+
steps:
64+
- name: Disable autocrlf
65+
if: "contains(matrix.os, 'windows-latest')"
66+
run: |-
67+
git config --global core.autocrlf false
68+
git config --global core.eol lf
69+
70+
- uses: actions/checkout@v2
71+
72+
- name: Setup Helm
73+
uses: azure/[email protected]
74+
with:
75+
version: ${{ env.VERSION_HELM }}
76+
77+
- name: Setup WSL
78+
if: "contains(matrix.shell, 'wsl')"
79+
uses: Vampire/setup-wsl@v1
80+
81+
- name: Setup Cygwin
82+
if: "contains(matrix.shell, 'cygwin')"
83+
uses: egor-tensin/setup-cygwin@v3
84+
with:
85+
platform: x64
86+
87+
- name: helm plugin install
88+
run: helm plugin install .
89+
90+
integration-tests:
91+
name: Integration Tests
92+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
93+
needs: [build]
94+
runs-on: ubuntu-latest
95+
steps:
96+
- uses: engineerd/[email protected]
97+
with:
98+
version: "v0.11.1"
99+
100+
- uses: actions/checkout@v2
101+
102+
- name: Setup Helm
103+
uses: azure/[email protected]
104+
with:
105+
version: ${{ env.VERSION_HELM }}
106+
107+
- name: helm plugin install
108+
run: helm plugin install .
109+
110+
- name: helm create helm-diff
111+
run: helm create helm-diff
112+
113+
- name: helm diff upgrade --install helm-diff ./helm-diff
114+
run: helm diff upgrade --install helm-diff ./helm-diff
115+
116+
- name: helm upgrade -i helm-diff ./helm-diff
117+
run: helm upgrade -i helm-diff ./helm-diff
118+
119+
- name: helm diff upgrade -C 3 --set replicaCount=2 --install helm-diff ./helm-diff
120+
run: helm diff upgrade -C 3 --set replicaCount=2 --install helm-diff ./helm-diff
121+
122+
shell-lint:
123+
name: Lint install-binary.sh
124+
runs-on: ubuntu-latest
125+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
126+
continue-on-error: true
127+
steps:
128+
- uses: actions/[email protected]
129+
- uses: luizm/[email protected]
130+
with:
131+
sh_checker_exclude: "scripts"
132+
sh_checker_checkbashisms_enable: true

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ docker-run-release: export pkg=/go/src/github.com/databus23/helm-diff
5353
docker-run-release:
5454
git checkout master
5555
git push
56-
docker run -it --rm -e GITHUB_TOKEN -v $(shell pwd):$(pkg) -w $(pkg) golang:1.7.5 make bootstrap release
56+
docker run -it --rm -e GITHUB_TOKEN -v $(shell pwd):$(pkg) -w $(pkg) golang:1.17.5 make bootstrap release
5757

5858
.PHONY: dist
5959
dist: export COPYFILE_DISABLE=1 #teach OSX tar to not put ._* files in tar archive

0 commit comments

Comments
 (0)