Skip to content

Commit

Permalink
pick changes form getsops#911
Browse files Browse the repository at this point in the history
pick changes form getsops#911
  • Loading branch information
MaxPeal committed Feb 9, 2022
1 parent 6130ffe commit 30f8d79
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,26 @@ on:

jobs:
build:
name: Build and test ${{ matrix.os }}
name: Build and test ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
matrix:
os: [linux, darwin, windows]
arch: [amd64, arm64]
exclude:
- os: windows
arch: arm64
env:
VAULT_VERSION: "1.1.3"
VAULT_TOKEN: "root"
VAULT_ADDR: "http://127.0.0.1:8200"
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install git -y
- name: Set up Go 1.13
- name: Set up Go 1.16
uses: actions/setup-go@v2
with:
go-version: 1.13
go-version: 1.16
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand All @@ -37,13 +41,24 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build
- name: Build Linux and Darwin
if: matrix.os != 'windows'
run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o sops-${{ matrix.os }}-${{ matrix.arch }}-${{ github.sha }} -v ./cmd/sops
- name: Build Windows
if: matrix.os == 'windows'
run: GOOS=${{ matrix.os }} go build -o sops-${{ matrix.os }}-${{ github.sha }} -v ./cmd/sops
- name: Import test GPG keys
run: for i in 1 2 3 4 5; do gpg --import pgp/sops_functional_tests_key.asc && break || sleep 15; done
- name: Test
run: make test
- name: Upload artifact
- name: Upload artifact for Linux and Darwin
if: matrix.os != 'windows'
uses: actions/upload-artifact@v2
with:
name: sops-${{ matrix.os }}-${{ matrix.arch }}-${{ github.sha }}
path: sops-${{ matrix.os }}-${{ matrix.arch }}-${{ github.sha }}
- name: Upload artifact for Windows
if: matrix.os == 'windows'
uses: actions/upload-artifact@v2
with:
name: sops-${{ matrix.os }}-${{ github.sha }}
Expand All @@ -63,9 +78,9 @@ jobs:
uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: sops-linux-${{ github.sha }}
name: sops-linux-amd64-${{ github.sha }}
- name: Move SOPS binary
run: mv sops-linux-${{ github.sha }} ./functional-tests/sops
run: mv sops-linux-amd64-${{ github.sha }} ./functional-tests/sops
- name: Make SOPS binary executable
run: chmod +x ./functional-tests/sops
- name: Download Vault
Expand Down

0 comments on commit 30f8d79

Please sign in to comment.