Skip to content

Commit

Permalink
ci: Use Docker for CI on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
jkayani authored and werne2j committed Sep 7, 2021
1 parent 2c46074 commit 30066e1
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 14 deletions.
37 changes: 26 additions & 11 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
name: Pipeline

on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main, next]

jobs:
CI:
name: CI
linux:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker
uses: docker/setup-buildx-action@v1

- name: Download deps
run: docker build . -t ci

# Disable network so that Azure specific behavior doesn't happen
- name: Quality
run: docker run --network none --env GOPATH="" --rm -v $PWD:/go/work ci make quality

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1

- name: Build and test plugin
run: docker run --network none --env GOPATH="" --rm -v $PWD:/go/work ci make e2e
mac:
strategy:
fail-fast: false
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -27,8 +45,5 @@ jobs:
- name: Quality checks
run: make quality

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1

- name: Build and test plugin
run: make e2e
run: make e2e
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM golang@sha256:a92abf53d0ac8dd292b432525c15ce627554546ebc4164d1d4149256998122ce

RUN apk add make

ADD go.mod go.mod
ADD go.sum go.sum

ENV GOPATH=""
ENV CGO_ENABLED=0
RUN go mod download

VOLUME work
WORKDIR work
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
BINARY=argocd-vault-plugin
VERSION=1.1.1
OS_ARCH=darwin_amd64

default: build

quality:
go vet github.com/IBM/argocd-vault-plugin/...
go vet github.com/IBM/argocd-vault-plugin
go test -v -coverprofile cover.out ./...

build:
Expand Down

0 comments on commit 30066e1

Please sign in to comment.