Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.github: move runners onto ubicloud #1665

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 116 additions & 28 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ on: # yamllint disable-line rule:truthy
types:
- "checks_requested"
env:
GO_VERSION: "~1.21.3"
GO_VERSION: "~1.21.4"
jobs:
paths-filter:
runs-on: "buildjet-2vcpu-ubuntu-2204"
runs-on: "ubicloud-standard-2"
outputs:
codechange: "${{ steps.code-filter.outputs.codechange }}"
protochange: "${{ steps.proto-filter.outputs.protochange }}"
Expand Down Expand Up @@ -42,9 +42,46 @@ jobs:
- "buf.work.yaml"
- "proto/**"
- "go.mod"
lint:
name: "Lint"
runs-on: "ubicloud-standard-8"
steps:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
- name: "Lint Everything but Go"
run: "go run mage.go lint:extra"
- uses: "chainguard-dev/actions/nodiff@main"
with:
path: ""
fixup-command: "go run mage.go lint:extra"
- name: "Lint Go"
run: "go run mage.go lint:go"
- uses: "chainguard-dev/actions/nodiff@main"
with:
path: ""
fixup-command: "go run mage.go lint:go"

analyzers-unit-tests:
name: "Analyzers Unit Tests"
runs-on: "ubicloud-standard-2"
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 }}"
go-version-file: "tools/analyzers/go.mod"
cache-dependency-path: "tools/analyzers/go.sum"
- name: "Analyzer tests"
run: "go run mage.go test:analyzers"

build:
name: "Build Binary & Image"
runs-on: "buildjet-4vcpu-ubuntu-2204"
runs-on: "ubicloud-standard-8"
needs: "paths-filter"
if: |
needs.paths-filter.outputs.codechange == 'true'
Expand All @@ -59,8 +96,12 @@ jobs:

unit:
name: "Unit"
runs-on: "buildjet-4vcpu-ubuntu-2204"
needs: "paths-filter"
runs-on: "ubicloud-standard-16"
needs:
- "paths-filter"
- "lint"
- "analyzers-unit-tests"
- "build"
if: |
needs.paths-filter.outputs.codechange == 'true'
steps:
Expand All @@ -73,8 +114,10 @@ jobs:

integration:
name: "Integration Tests"
runs-on: "buildjet-4vcpu-ubuntu-2204"
needs: "paths-filter"
runs-on: "ubicloud-standard-8"
needs:
- "paths-filter"
- "build"
if: |
needs.paths-filter.outputs.codechange == 'true'
steps:
Expand All @@ -87,8 +130,10 @@ jobs:

datastore:
name: "Datastore Tests"
runs-on: "buildjet-4vcpu-ubuntu-2204"
needs: "paths-filter"
runs-on: "ubicloud-standard-8"
needs:
- "paths-filter"
- "unit"
if: |
needs.paths-filter.outputs.codechange == 'true'
strategy:
Expand All @@ -107,8 +152,10 @@ jobs:

e2e:
name: "E2E"
runs-on: "buildjet-8vcpu-ubuntu-2204"
needs: "paths-filter"
runs-on: "ubicloud-standard-8"
needs:
- "paths-filter"
- "unit"
if: |
needs.paths-filter.outputs.codechange == 'true'
steps:
Expand Down Expand Up @@ -157,24 +204,10 @@ jobs:
with:
name: "node-logs"
path: "e2e/newenemy/*.log"
analyzers-unit-tests:
name: "Analyzers Unit Tests"
runs-on: "buildjet-2vcpu-ubuntu-2204"
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 }}"
go-version-file: "tools/analyzers/go.mod"
cache-dependency-path: "tools/analyzers/go.sum"
- name: "Analyzer tests"
run: "go run mage.go test:analyzers"

development:
name: "WASM Tests"
runs-on: "buildjet-2vcpu-ubuntu-2204"
runs-on: "ubicloud-standard-2"
needs: "paths-filter"
if: |
needs.paths-filter.outputs.codechange == 'true'
Expand All @@ -188,7 +221,7 @@ jobs:

protobuf:
name: "Generate Protobufs"
runs-on: "buildjet-2vcpu-ubuntu-2204"
runs-on: "ubicloud-standard-2"
needs: "paths-filter"
if: |
needs.paths-filter.outputs.protochange == 'true'
Expand All @@ -213,3 +246,58 @@ jobs:
input: "proto/internal"
against: "https://github.com/authzed/spicedb.git#branch=main,subdir=proto/internal"
buf_token: "${{ secrets.BUF_REGISTRY_TOKEN }}"

codeql:
name: "Analyze with CodeQL"
runs-on: "ubicloud-standard-32"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have the ubicloud-standard-32 label. 16 vCPUs is the largest runner for now.

Here is the list of all valid labels: https://github.com/ubicloud/ubicloud/blob/main/config/github_runner_labels.yml

needs: "unit"
if: |
github.ref == 'refs/heads/main'
permissions:
actions: "read"
contents: "read"
security-events: "write"
strategy:
fail-fast: false
matrix:
language: ["go"]
steps:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/codeql@main"

trivy:
name: "Trivvy: Analyze FS and Image"
runs-on: "ubicloud-standard-2"
needs: "unit"
if: |
github.ref == 'refs/heads/main'
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"
# Workaround until goreleaser release supports --single-target
# makes the build faster by not building everything
- name: "modify goreleaser config to skip building all targets"
run: |
echo "partial:
by: target" >> .goreleaser.yml
- uses: "goreleaser/goreleaser-action@v4"
id: "goreleaser"
with:
distribution: "goreleaser-pro"
version: "latest"
args: "release --clean --split --snapshot"
env:
GORELEASER_KEY: "${{ secrets.GORELEASER_KEY }}"
- name: "Obtain container image to scan"
run: 'echo "IMAGE_VERSION=$(jq .version dist/linux_amd64/metadata.json --raw-output)" >> $GITHUB_ENV'
- name: "run trivy on release image"
run: "docker run -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy image --format table --exit-code 1 --ignore-unfixed --vuln-type os,library --no-progress --severity CRITICAL,HIGH,MEDIUM authzed/spicedb:v${{ env.IMAGE_VERSION }}-amd64"
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: "buildjet-2vcpu-ubuntu-2204"
runs-on: "ubicloud-standard-2"
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: "buildjet-2vcpu-ubuntu-2204"
runs-on: "ubicloud-standard-2"
steps:
- uses: "actions/labeler@v3"
with:
Expand Down
90 changes: 0 additions & 90 deletions .github/workflows/lint.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ permissions:
contents: "write"
packages: "write"
env:
GO_VERSION: "~1.21.3"
GO_VERSION: "~1.21.4"
jobs:
goreleaser:
runs-on: "buildjet-4vcpu-ubuntu-2204"
runs-on: "ubicloud-standard-4"
steps:
- uses: "actions/checkout@v3"
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ permissions:
contents: "write"
packages: "write"
env:
GO_VERSION: "~1.21.3"
GO_VERSION: "~1.21.4"
jobs:
goreleaser:
runs-on: "buildjet-4vcpu-ubuntu-2204"
runs-on: "ubicloud-standard-4"
steps:
- uses: "actions/checkout@v3"
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wasm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on: # yamllint disable-line rule:truthy
permissions:
contents: "write"
env:
GO_VERSION: "~1.21.3"
GO_VERSION: "~1.21.4"
jobs:
build:
name: "Build WASM"
runs-on: "buildjet-2vcpu-ubuntu-2204"
runs-on: "ubicloud-standard-2"
steps:
- uses: "actions/checkout@v3"
with:
Expand Down
Loading