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

build(nix): add haqq flake app; add l5, allnodes and p2p seeds; prepare flake for nixos-search; self-hosted runners #283

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
watch_file nix/devshell.nix
watch_file nix/devshell/default.nix
watch_file nix/devshell/common.nix
use flake . --impure
18 changes: 6 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
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,26 +33,20 @@ 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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
run: git lfs pull
-
name: Build docker
run:
run: |
docker build . --file docker/build.Dockerfile

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
5 changes: 3 additions & 2 deletions .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, ubuntu]
timeout-minutes: 10
steps:
- uses: actions/setup-go@v5
Expand All @@ -26,6 +26,7 @@ jobs:
- uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: latest
version: 'v1.55.2'
args: --timeout 10m
github-token: ${{ secrets.github_token }}

34 changes: 17 additions & 17 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ jobs:
- run: exit 0

build:
name: Check that proto builds and committed
runs-on: ubuntu-latest
name: Check that proto builds and commited
runs-on: [self-hosted, nixos]
steps:
- uses: actions/checkout@v4
- uses: haqq-network/nix-action@master
with:
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: |
nix develop --impure #ci --command ci-proto

Expand All @@ -33,19 +30,22 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.28.1
- uses: bufbuild/buf-setup-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: bufbuild/buf-lint-action@v1
with:
input: "proto"

# 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
# steps:
# - uses: actions/checkout@v4
# - uses: bufbuild/buf-setup-action@v1.28.1
# - uses: bufbuild/buf-breaking-action@v1
# with:
# input: "proto"
# against: "https://github.com/${{ github.repository }}.git#branch=${{ github.event.pull_request.base.ref }},ref=HEAD~1,subdir=proto"
break-check:
name: Proto break-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: bufbuild/buf-breaking-action@v1
with:
input: "proto"
against: "https://github.com/${{ github.repository }}.git#branch=${{ github.event.pull_request.base.ref }},ref=HEAD~1,subdir=proto"
17 changes: 12 additions & 5 deletions .github/workflows/test-node-bootstrap.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
name: update-flake-lock
name: test node bootstrap
on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: '0 0 * * 0' # runs weekly on Sunday at 00:00
# NOTE Disabled for now because tests fail with a timeout.
# schedule:
# - cron: '0 0 * * 0' # runs weekly on Sunday at 00:00
# pull_request:
# push:
# branches:
# - master

jobs:
lockfile:
runs-on: ubuntu-cpu16-ram64
node-bootstrap:
timeout-minutes: 370
runs-on: [self-hosted, nixos]
steps:
- uses: actions/checkout@v4
- name: Test node bootstrap
run: |
nix build .#packages.x86_64-linux.nixos-test --no-sandbox --print-build-logs
11 changes: 5 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 All @@ -59,19 +59,18 @@ jobs:
go.sum
- name: Test unit
run: |
id
env
make test-unit-cover
- name: Upload coverage reports to Codecov
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
run: |
nix build .#haqq-with-tests --print-build-logs
7 changes: 7 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
go.mod @haqq-network/node
go.sum @haqq-network/node

**/*.go @haqq-network/node

**/*.nix @haqq-network/node-nix
flake.lock @haqq-network/node-nix
Loading
Loading