ci: fix lint workflow (#4229) #8628
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
permissions: | |
contents: read | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
test: | |
strategy: | |
matrix: | |
go-version: [1.20.x] | |
node-version: [16.x] | |
platform: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: set env vars | |
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | |
with: | |
fetch-depth: 0 | |
- name: cache go binaries | |
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 | |
id: cache-go-bin | |
with: | |
path: ~/go/bin | |
key: ${{ runner.os }}-${{ hashFiles('**/go.mod') }} | |
restore-keys: ${{ runner.os }}-go-bin | |
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 | |
with: | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
~/Library/Caches/go-build | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: ${{ runner.os }}-go- | |
- run: make deps-build | |
- name: test | |
run: make test | |
cover: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: [1.20.x] | |
node-version: [16.x] | |
steps: | |
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c | |
with: | |
node-version: ${{ matrix.node-version }} | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | |
with: | |
fetch-depth: 0 | |
- name: set env vars | |
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
- name: cache go binaries | |
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 | |
id: cache-go-bin | |
with: | |
path: ~/go/bin | |
key: ${{ runner.os }}-${{ hashFiles('**/go.mod') }} | |
restore-keys: ${{ runner.os }}-go-bin | |
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 | |
with: | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
~/Library/Caches/go-build | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: ${{ runner.os }}-go- | |
- name: cover | |
run: make cover | |
- uses: jandelgado/gcov2lcov-action@c680c0f7c7442485f1749eb2a13e54a686e76eb5 | |
name: convert coverage to lcov | |
with: | |
infile: coverage.txt | |
outfile: coverage.lcov | |
- name: upload to coveralls | |
uses: coverallsapp/github-action@f350da2c033043742f89e8c0b7b5145a1616da6d | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: coverage.lcov | |
integration: | |
strategy: | |
fail-fast: false | |
matrix: | |
go-version: [1.20.x] | |
node-version: [16.x] | |
platform: [ubuntu-latest] | |
deployment: [multi, single] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: set env vars | |
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | |
with: | |
fetch-depth: 0 | |
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 | |
with: | |
path: | | |
~/go/pkg | |
~/.cache/go-build | |
~/Library/Caches/go-build | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: build dev docker image | |
run: | | |
./scripts/build-dev-docker.bash | |
- name: start cluster | |
run: | | |
export POMERIUM_TAG=dev | |
cd ./integration/clusters/${{matrix.deployment}} | |
docker-compose up -d | |
- name: integration tests | |
run: | | |
(cd ./integration/clusters/${{matrix.deployment}} && docker-compose logs -f &) | |
go test -v ./integration/... | |
build: | |
strategy: | |
matrix: | |
go-version: [1.20.x] | |
node-version: [16.x] | |
platform: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c | |
with: | |
node-version: ${{ matrix.node-version }} | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | |
with: | |
fetch-depth: 0 | |
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 | |
with: | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
~/Library/Caches/go-build | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: build | |
run: | | |
make build-deps | |
make build | |
- name: save binary | |
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce | |
with: | |
path: bin/pomerium* | |
name: pomerium ${{ github.run_id }} ${{ matrix.platform }} | |
retention-days: 1 | |
build-docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | |
with: | |
fetch-depth: 0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c | |
- name: Docker Build | |
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: false | |
precommit: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' | |
steps: | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 | |
with: | |
go-version: 1.20.x | |
- uses: actions/setup-python@57ded4d7d5e986d7296eab16560982c6dd7c923b | |
with: | |
python-version: "3.x" | |
- uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 | |
with: | |
extra_args: --show-diff-on-failure --from-ref ${{ | |
github.event.pull_request.base.sha }} --to-ref ${{ | |
github.event.pull_request.head.sha }} | |
env: | |
SKIP: lint | |
license: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: [1.20.x] | |
platform: [ubuntu-latest] | |
needs: | |
- build | |
steps: | |
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 | |
with: | |
go-version: 1.20.x | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | |
- name: retrieve binary | |
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a | |
with: | |
name: pomerium ${{ github.run_id }} ${{ matrix.platform }} | |
path: bin/ | |
- name: download envoy | |
run: make get-envoy | |
- name: FOSSA Scan | |
uses: fossa-contrib/fossa-action@6728dc6fe9a068c648d080c33829ffbe56565023 | |
with: | |
fossa-api-key: 18f4ef488f514d06874b75f5809cea93 |