Files
releases/.github/workflows/pull-request.yaml
Stephan Renatus 4a4185d799 ci: ensure we can build with different go versions
We only check the build, not the tests.
And we only check the latest release of the 1.15 and 1.16 series.
since 1.17 is what we build and test with anyways.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2021-08-30 16:56:53 -07:00

253 lines
6.0 KiB
YAML

name: PR Check
on: [pull_request]
jobs:
# All jobs essentially re-create the `ci-release-test` make target, but are split
# up for parallel runners for faster PR feedback and a nicer UX.
go-build-linux:
name: Go Build (linux)
runs-on: ubuntu-18.04
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Build Linux
run: make ci-go-ci-build-linux ci-go-ci-build-linux-static
timeout-minutes: 30
- name: Upload binaries
uses: actions/upload-artifact@v2
if: always()
with:
name: binaries
path: _release
go-build-windows:
name: Go Build (windows)
runs-on: ubuntu-18.04
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Build Windows
run: make ci-go-ci-build-windows
timeout-minutes: 30
- name: Upload binaries
uses: actions/upload-artifact@v2
if: always()
with:
name: binaries
path: _release
go-build-darwin:
name: Go Build (darwin)
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- id: go_version
name: Read go version
run: echo "::set-output name=go_version::$(cat .go-version)"
- name: Install Go (${{ steps.go_version.outputs.go_version }})
uses: actions/setup-go@v2
with:
go-version: ${{ steps.go_version.outputs.go_version }}
- name: Build Darwin
run: make ci-build-darwin
timeout-minutes: 30
- name: Upload binaries (darwin)
uses: actions/upload-artifact@v2
if: always()
with:
name: binaries
path: _release
go-test:
name: Go Test
runs-on: ubuntu-18.04
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Unit Test Golang
run: make ci-go-test-coverage
timeout-minutes: 30
go-perf:
name: Go Perf
runs-on: ubuntu-18.04
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Benchmark Test Golang
run: make ci-go-perf
timeout-minutes: 30
go-quick-fuzz:
name: Go quick fuzz
runs-on: ubuntu-18.04
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Run fuzz check (3m)
run: make ci-go-check-fuzz FUZZ_TIME=180
timeout-minutes: 30
go-lint:
name: Go Lint
runs-on: ubuntu-18.04
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Golang Style and Lint Check
run: make check
timeout-minutes: 30
wasm:
name: WASM
runs-on: ubuntu-18.04
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Build and Test WASM
run: make ci-wasm
timeout-minutes: 15
check-generated:
name: Check Generated
runs-on: ubuntu-18.04
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Check Working Copy
run: make ci-check-working-copy
timeout-minutes: 15
wasm-go-sdk-e2e:
name: OPA Wasm SDK e2e
runs-on: ubuntu-18.04
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Build and Test Wasm SDK
run: make ci-go-wasm-sdk-e2e-test
timeout-minutes: 30
race-detector:
name: Go Race Detector
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Test with Race Detector
run: make ci-go-race-detector
smoke-test-docker-images:
name: docker image smoke test
runs-on: ubuntu-latest
needs: [go-build-linux, go-build-darwin, go-build-windows]
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Download release binaries
uses: actions/download-artifact@v2
with:
name: binaries
path: _release
- name: Test images
run: make ci-image-smoke-test
smoke-test-binaries:
runs-on: ${{ matrix.os }}
needs: [go-build-linux, go-build-darwin, go-build-windows]
strategy:
matrix:
include:
- os: ubuntu-latest
exec: opa_linux_amd64
- os: ubuntu-latest
exec: opa_linux_amd64_static
wasm: disabled
- os: macos-latest
exec: opa_darwin_amd64
- os: windows-latest
exec: opa_windows_amd64.exe
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Download release binaries
uses: actions/download-artifact@v2
with:
name: binaries
path: _release
- name: Test binaries (Rego)
run: make ci-binary-smoke-test-rego BINARY=${{ matrix.exec }}
- name: Test binaries (Wasm)
run: make ci-binary-smoke-test-wasm BINARY=${{ matrix.exec }}
if: matrix.wasm != 'disabled'
nodejs-wasm-example:
name: npm-opa-wasm
runs-on: ubuntu-latest
needs: [go-build-linux, go-build-darwin, go-build-windows]
steps:
- name: Download release binaries
uses: actions/download-artifact@v2
with:
name: binaries
path: _release
- name: Prepare OPA
run: |
ln -s _release/*/opa_linux_amd64 opa
chmod +x opa
echo $(pwd) >> $GITHUB_PATH
- name: Check out npm-opa-wasm
uses: actions/checkout@v2
with:
repository: open-policy-agent/npm-opa-wasm
path: npm-opa-wasm
- name: Run npm-opa-wasm nodejs-app examples
run: |
npm install
./e2e.sh
working-directory: npm-opa-wasm
go-version-build:
name: Go compat builds
runs-on: ubuntu-latest
strategy:
matrix:
include:
- version: "1.16"
- version: "1.15"
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Build
run: make ci-go-ci-build-linux GOVERSION=${{ matrix.version }}
timeout-minutes: 30