|
| 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 | + |
| 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 | + |
| 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 | + |
| 129 | + |
| 130 | + with: |
| 131 | + sh_checker_exclude: "scripts" |
| 132 | + sh_checker_checkbashisms_enable: true |
0 commit comments