Skip to content

Commit

Permalink
Merge pull request #1591 from jzelinskie/buildjet
Browse files Browse the repository at this point in the history
.github: move to buildjet
  • Loading branch information
jzelinskie authored Oct 18, 2023
2 parents a3eedf8 + cf1feba commit 8cff375
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 60 deletions.
52 changes: 12 additions & 40 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
GO_VERSION: "~1.21.3"
jobs:
paths-filter:
runs-on: "ubuntu-latest"
runs-on: "buildjet-2vcpu-ubuntu-2204"
outputs:
codechange: "${{ steps.code-filter.outputs.codechange }}"
protochange: "${{ steps.proto-filter.outputs.protochange }}"
Expand Down Expand Up @@ -43,8 +43,8 @@ jobs:
- "proto/**"
- "go.mod"
build:
name: "Build Binary"
runs-on: "ubuntu-latest"
name: "Build Binary & Image"
runs-on: "buildjet-4vcpu-ubuntu-2204"
needs: "paths-filter"
if: |
needs.paths-filter.outputs.codechange == 'true'
Expand All @@ -54,24 +54,12 @@ jobs:
with:
go-version: "${{ env.GO_VERSION }}"
- uses: "authzed/actions/go-build@main"

image-build:
name: "Build Container Image"
runs-on: "ubuntu-latest-4-cores"
needs: "paths-filter"
if: |
needs.paths-filter.outputs.codechange == 'true'
steps:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
- name: "Image tests"
run: "go run mage.go test:image"

unit:
name: "Unit"
runs-on: "ubuntu-latest-4-cores"
runs-on: "buildjet-4vcpu-ubuntu-2204"
needs: "paths-filter"
if: |
needs.paths-filter.outputs.codechange == 'true'
Expand All @@ -85,7 +73,7 @@ jobs:

integration:
name: "Integration Tests"
runs-on: "ubuntu-latest-4-cores"
runs-on: "buildjet-4vcpu-ubuntu-2204"
needs: "paths-filter"
if: |
needs.paths-filter.outputs.codechange == 'true'
Expand All @@ -99,7 +87,7 @@ jobs:

datastore:
name: "Datastore Tests"
runs-on: "ubuntu-latest-4-cores"
runs-on: "buildjet-4vcpu-ubuntu-2204"
needs: "paths-filter"
if: |
needs.paths-filter.outputs.codechange == 'true'
Expand All @@ -114,28 +102,12 @@ jobs:
go-version: "${{ env.GO_VERSION }}"
- name: "Integration tests"
run: "go run mage.go testds:${{ matrix.datastore }}"

datastoreconsistency:
name: "Datastore Consistency Tests"
runs-on: "ubuntu-latest-4-cores"
needs: "paths-filter"
if: |
needs.paths-filter.outputs.codechange == 'true'
strategy:
fail-fast: false
matrix:
datastore: ["crdb", "mysql", "postgres", "spanner"]
steps:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
- name: "Integration tests"
run: "go run mage.go testcons:${{ matrix.datastore }}"

e2e:
name: "E2E"
runs-on: "ubuntu-latest-8-cores"
runs-on: "buildjet-8vcpu-ubuntu-2204"
needs: "paths-filter"
if: |
needs.paths-filter.outputs.codechange == 'true'
Expand All @@ -148,7 +120,7 @@ jobs:
cache-dependency-path: "e2e/go.sum"
- name: "Cache Binaries"
id: "cache-binaries"
uses: "actions/cache@v2"
uses: "buildjet/cache@v3"
with:
path: |
e2e/newenemy/cockroach
Expand All @@ -162,7 +134,7 @@ jobs:
run: |
curl https://binaries.cockroachdb.com/cockroach-v22.1.5.linux-amd64.tgz | tar -xz && mv cockroach-v22.1.5.linux-amd64/cockroach ./cockroach
curl -fsSL https://mirrors.chaos-mesh.org/chaosd-v1.1.1-linux-amd64.tar.gz | tar -xz && mv chaosd-v1.1.1-linux-amd64/chaosd ./chaosd
- uses: "actions/cache@v2"
- uses: "buildjet/cache@v3"
with:
path: |
~/.cache/go-build
Expand All @@ -187,7 +159,7 @@ jobs:
path: "e2e/newenemy/*.log"
analyzers-unit-tests:
name: "Analyzers Unit Tests"
runs-on: "ubuntu-latest"
runs-on: "buildjet-2vcpu-ubuntu-2204"
needs: "paths-filter"
if: |
needs.paths-filter.outputs.codechange == 'true'
Expand All @@ -202,7 +174,7 @@ jobs:
run: "go run mage.go test:analyzers"
development:
name: "WASM Tests"
runs-on: "ubuntu-latest"
runs-on: "buildjet-2vcpu-ubuntu-2204"
needs: "paths-filter"
if: |
needs.paths-filter.outputs.codechange == 'true'
Expand All @@ -216,7 +188,7 @@ jobs:

protobuf:
name: "Generate Protobufs"
runs-on: "ubuntu-latest"
runs-on: "buildjet-2vcpu-ubuntu-2204"
needs: "paths-filter"
if: |
needs.paths-filter.outputs.protochange == 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on: # yamllint disable-line rule:truthy
jobs:
cla:
name: "Check Signature"
runs-on: "ubuntu-latest"
runs-on: "buildjet-2vcpu-ubuntu-2204"
steps:
- uses: "authzed/actions/cla-check@main"
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on: # yamllint disable-line rule:truthy
- "checks_requested"
jobs:
triage:
runs-on: "ubuntu-latest"
runs-on: "buildjet-2vcpu-ubuntu-2204"
steps:
- uses: "actions/labeler@v3"
with:
Expand Down
24 changes: 9 additions & 15 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
jobs:
go-lint:
name: "Lint Go"
runs-on: "ubuntu-latest-4-cores"
runs-on: "buildjet-4vcpu-ubuntu-2204"
steps:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/setup-go@main"
Expand All @@ -30,7 +30,7 @@ jobs:

extra-lint:
name: "Lint YAML & Markdown"
runs-on: "ubuntu-latest"
runs-on: "buildjet-2vcpu-ubuntu-2204"
steps:
- uses: "actions/checkout@v3"
- name: "Lint Everything Else"
Expand All @@ -42,7 +42,7 @@ jobs:

codeql:
name: "Analyze with CodeQL"
runs-on: "ubuntu-latest-8-cores"
runs-on: "buildjet-8vcpu-ubuntu-2204"
permissions:
actions: "read"
contents: "read"
Expand All @@ -55,27 +55,21 @@ jobs:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/codeql@main"

trivy-fs:
name: "Analyze FS with Trivy"
runs-on: "ubuntu-latest"
trivy:
name: "Trivvy: Analyze FS and Image"
runs-on: "buildjet-2vcpu-ubuntu-2204"
steps:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
- uses: "aquasecurity/trivy-action@master"
with:
scan-type: "fs"
ignore-unfixed: true
format: "table"
exit-code: "1"
severity: "CRITICAL,HIGH,MEDIUM"

trivy-image:
name: "Analyze Release Image with Trivy"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
# Workaround until goreleaser release supports --single-target
# makes the build faster by not building everything
- name: "modify goreleaser config to skip building all targets"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
GO_VERSION: "~1.21.3"
jobs:
goreleaser:
runs-on: "ubuntu-latest"
runs-on: "buildjet-4vcpu-ubuntu-2204"
steps:
- uses: "actions/checkout@v3"
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
GO_VERSION: "~1.21.3"
jobs:
goreleaser:
runs-on: "ubuntu-latest"
runs-on: "buildjet-4vcpu-ubuntu-2204"
steps:
- uses: "actions/checkout@v3"
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wasm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
jobs:
build:
name: "Build WASM"
runs-on: "ubuntu-latest"
runs-on: "buildjet-2vcpu-ubuntu-2204"
steps:
- uses: "actions/checkout@v3"
with:
Expand Down

0 comments on commit 8cff375

Please sign in to comment.