Skip to content

Migrate to GH actions #335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*.sh]
indent_style = space
indent_size = 2
max_line_length = 120
trim_trailing_whitespace = true
shell_variant = posix
132 changes: 132 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
---
name: CI

env:
VERSION_GO: '1.17.5'
VERSION_HELM: 'v3.7.0'

on:
pull_request:
push:
branches:
- master

jobs:
build:
name: "Build & Test"
if: "!contains(github.event.head_commit.message, '[ci skip]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ${{ env.VERSION_GO }}

- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Install dependencies
run: make bootstrap

- name: Run unit tests
run: make test

- name: Verify installation
run: |
mkdir -p helmhome
make install HELM_HOME=helmhome
helmhome/plugins/helm-diff/bin/diff version

helm-install:
name: helm install
if: "!contains(github.event.head_commit.message, '[ci skip]')"
needs: [build]
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
shell: [ default ]
experimental: [ false ]
include:
- os: windows-latest
shell: wsl
experimental: false
- os: windows-latest
shell: cygwin
experimental: true
steps:
- name: Disable autocrlf
if: "contains(matrix.os, 'windows-latest')"
run: |-
git config --global core.autocrlf false
git config --global core.eol lf

- uses: actions/checkout@v2

- name: Setup Helm
uses: azure/[email protected]
with:
version: ${{ env.VERSION_HELM }}

- name: Setup WSL
if: "contains(matrix.shell, 'wsl')"
uses: Vampire/setup-wsl@v1

- name: Setup Cygwin
if: "contains(matrix.shell, 'cygwin')"
uses: egor-tensin/setup-cygwin@v3
with:
platform: x64

- name: helm plugin install
run: helm plugin install .

integration-tests:
name: Integration Tests
if: "!contains(github.event.head_commit.message, '[ci skip]')"
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: engineerd/[email protected]
with:
version: "v0.11.1"

- uses: actions/checkout@v2

- name: Setup Helm
uses: azure/[email protected]
with:
version: ${{ env.VERSION_HELM }}

- name: helm plugin install
run: helm plugin install .

- name: helm create helm-diff
run: helm create helm-diff

- name: helm diff upgrade --install helm-diff ./helm-diff
run: helm diff upgrade --install helm-diff ./helm-diff

- name: helm upgrade -i helm-diff ./helm-diff
run: helm upgrade -i helm-diff ./helm-diff

- name: helm diff upgrade -C 3 --set replicaCount=2 --install helm-diff ./helm-diff
run: helm diff upgrade -C 3 --set replicaCount=2 --install helm-diff ./helm-diff

shell-lint:
name: Lint install-binary.sh
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
continue-on-error: true
steps:
- uses: actions/[email protected]
- uses: luizm/[email protected]
with:
sh_checker_exclude: "scripts"
sh_checker_checkbashisms_enable: true
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ docker-run-release: export pkg=/go/src/github.com/databus23/helm-diff
docker-run-release:
git checkout master
git push
docker run -it --rm -e GITHUB_TOKEN -v $(shell pwd):$(pkg) -w $(pkg) golang:1.7.5 make bootstrap release
docker run -it --rm -e GITHUB_TOKEN -v $(shell pwd):$(pkg) -w $(pkg) golang:1.17.5 make bootstrap release

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