| 1 |
name: Go |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: [dev] |
| 6 |
pull_request: |
| 7 |
# This guards against unknown PR until a community member vet it and label it. |
| 8 |
types: [ labeled ] |
| 9 |
|
| 10 |
|
| 11 |
jobs: |
| 12 |
build: |
| 13 |
name: Build |
| 14 |
|
| 15 |
runs-on: ubuntu-latest |
| 16 |
|
| 17 |
strategy: |
| 18 |
matrix: |
| 19 |
go: ["1.19", "1.20"] |
| 20 |
|
| 21 |
steps: |
| 22 |
- name: Set up Go 1.x |
| 23 |
uses: actions/setup-go@v2 |
| 24 |
with: |
| 25 |
go-version: ${{ matrix.go }} |
| 26 |
id: go |
| 27 |
|
| 28 |
- name: Check out code into the Go module directory |
| 29 |
uses: actions/checkout@v2 |
| 30 |
|
| 31 |
- name: Get dependencies |
| 32 |
run: go get -v -t -d ./... |
| 33 |
|
| 34 |
# designed to only run on linux |
| 35 |
- name: Format Check |
| 36 |
run: if [ $(gofmt -l -s . | wc -l) -ne 0 ]; then echo "fmt failed"; exit 1; fi |
| 37 |
|
| 38 |
- name: Build |
| 39 |
run: go build ./apps/... |
| 40 |
|
| 41 |
- name: Unit Tests |
| 42 |
run: go test -race -short ./apps/cache/... ./apps/confidential/... ./apps/public/... ./apps/internal/... |
| 43 |
|
| 44 |
- name: Integration Tests |
| 45 |
run: go test -race ./apps/tests/integration/... |
| 46 |
env : |
| 47 |
clientId: ${{ secrets.LAB_APP_CLIENT_ID }} |
| 48 |
clientSecret: ${{ secrets.LAB_APP_CLIENT_SECRET }} |
| 49 |
oboConfidentialClientId: ${{ secrets.OBO_CONFIDENTIAL_APP_CLIENT_ID }} |
| 50 |
oboConfidentialClientSecret: ${{ secrets.OBO_CONFIDENTIAL_APP_CLIENT_SECRET }} |
| 51 |
oboPublicClientId: ${{ secrets.OBO_PUBLIC_APP_CLIENT_ID }} |
| 52 |
CI: ${{secrets.ENABLECI}} |