Skip to content

Commit

Permalink
ci: use self-hosted runners
Browse files Browse the repository at this point in the history
  • Loading branch information
azahi committed Jul 25, 2024
1 parent 6c2cce7 commit 5b94372
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 50 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ on:

jobs:
cleanup-runs:
runs-on: ubuntu-latest
runs-on: [self-hosted, nixos]
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"

build:
runs-on: ubuntu-cpu16-ram64
runs-on: [self-hosted, ubuntu]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand All @@ -33,28 +33,22 @@ jobs:
- run: |
make build
if: "env.GIT_DIFF != ''"
build-nix:
runs-on: ubuntu-cpu16-ram64
runs-on: [self-hosted, nixos]
steps:
- uses: actions/checkout@v4
- uses: haqq-network/nix-action@master
with:
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
cacheKeyPostfix: ${{ hashFiles('**/go.sum') }}
- name: Build nix package
run: |
nix build .#haqq --print-build-logs
check-nix:
runs-on: ubuntu-latest
runs-on: [self-hosted, nixos]
steps:
- uses: actions/checkout@v4
- uses: haqq-network/nix-action@master
with:
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
cacheKeyPostfix: ${{ hashFiles('**/go.sum') }}
- name: Check if nix package and Makefile versions match
- name: Check if Nix package and Makefile versions match
run: |
nix develop --impure .#ci --command ci-check-version
- name: Check if gomod2nix is up to date
- name: Check if gomod2nix file is up to date
run: |
nix develop --impure .#ci --command ci-check-gomod2nix
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: [self-hosted, ubuntu]
permissions:
actions: read
contents: read
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,18 @@ name: Build docker image

on:
push:

workflow_dispatch:

jobs:
docker:
runs-on: ubuntu-cpu16-ram64
runs-on: [self-hosted, ubuntu]
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v4
-
name: Git fetch everything
- name: Git fetch everything
run: git fetch --prune --unshallow
-
name: Pull LFS files
- name: Pull LFS files
run: git lfs pull
-
name: Build docker
- name: Build docker
run:
docker build . --file docker/build.Dockerfile

2 changes: 1 addition & 1 deletion .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
docker:
runs-on: ubuntu-cpu16-ram64
runs-on: [self-hosted, ubuntu]
steps:
-
name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dry-run-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
dry-run-goreleaser:
runs-on: ubuntu-cpu16-ram64
runs-on: [self-hosted, ubuntu]
environment: release
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "v*.*.*"
jobs:
goreleaser:
runs-on: ubuntu-cpu16-ram64
runs-on: [self-hosted, ubuntu]
environment: release
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
golangci:
name: Run golangci-lint
runs-on: ubuntu-latest
runs-on: [self-hosted, unbuntu]
timeout-minutes: 10
steps:
- uses: actions/setup-go@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/proto-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
push:
runs-on: ubuntu-latest
runs-on: [self-hosted, ubuntu]
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.28.1
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
proto-pass:
name: Proto Pass
runs-on: ubuntu-latest
runs-on: [self-hosted, ubuntu]
needs:
- build
- lint
Expand All @@ -18,7 +18,7 @@ jobs:

build:
name: Check that proto builds and committed
runs-on: ubuntu-latest
runs-on: [self-hosted, ubuntu]
steps:
- uses: actions/checkout@v4
- uses: haqq-network/nix-action@master
Expand All @@ -29,7 +29,7 @@ jobs:
lint:
name: Proto lint
runs-on: ubuntu-latest
runs-on: [self-hosted, ubuntu]
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
Expand All @@ -41,7 +41,7 @@ jobs:
# NOTE: This is disabled only for this merge request, it will be enabled in master branch
# break-check:
# name: Proto break-check
# runs-on: ubuntu-latest
# runs-on: [self-hosted, ubuntu]
# steps:
# - uses: actions/checkout@v4
# - uses: bufbuild/buf-setup-action@v1.28.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: push

jobs:
security:
runs-on: ubuntu-latest
runs-on: [self-hosted, ubuntu]
steps:
- uses: actions/checkout@v4
- uses: snyk/actions/setup@master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
stale:
runs-on: ubuntu-latest
runs-on: [self-hosted, ubuntu]
steps:
- uses: actions/stale@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-node-bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
lockfile:
runs-on: ubuntu-cpu16-ram64
runs-on: [self-hosted, nixos]
steps:
- name: Test node bootstrap
run: |
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ on:

jobs:
cleanup-runs:
runs-on: ubuntu-latest
runs-on: [self-hosted, nixos]
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"

install-tparse:
runs-on: ubuntu-latest
runs-on: [self-hosted, ubuntu]
steps:
- uses: actions/setup-go@v5
with:
Expand All @@ -32,7 +32,7 @@ jobs:
key: ${{ runner.os }}-go-tparse-binary

test-unit:
runs-on: ubuntu-cpu16-ram64
runs-on: [self-hosted, ubuntu]
steps:
- name: Set up go
uses: actions/setup-go@v5
Expand Down Expand Up @@ -64,14 +64,11 @@ jobs:
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

test-nix:
runs-on: ubuntu-cpu16-ram64
runs-on: [self-hosted, nixos]
steps:
- uses: actions/checkout@v4
- uses: haqq-network/nix-action@master
with:
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
cacheKeyPostfix: ${{ hashFiles('**/go.sum') }}
- name: Run nix package tests
- name: Run Nix package tests
run: |
nix build .#haqq-with-tests --print-build-logs
4 changes: 1 addition & 3 deletions .github/workflows/update-flake-lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ on:

jobs:
lockfile:
runs-on: ubuntu-latest
runs-on: [self-hosted, nixos]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@main
with:
Expand Down

0 comments on commit 5b94372

Please sign in to comment.