Skip to content

Commit

Permalink
build: implement a Justfile to replace GNUMakefile
Browse files Browse the repository at this point in the history
  • Loading branch information
shoenig committed Nov 15, 2024
1 parent 8dd570d commit 7336b08
Show file tree
Hide file tree
Showing 3 changed files with 338 additions and 14 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
runs-on: ${{ endsWith(github.repository, '-enterprise') && fromJSON('["self-hosted", "ondemand", "linux", "disk_gb=255", "type=m7a.2xlarge;m6a.2xlarge"]') || 'custom-linux-xl-nomad-22.04' }}
timeout-minutes: 15
steps:
- uses: extractions/setup-just@dd310ad5a97d8e7b41793f8ef055398d51ad4de6 # v2.0.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0 # needs tags for checkproto
Expand All @@ -46,11 +47,11 @@ jobs:
cache: true
go-version-file: .go-version
cache-dependency-path: '**/go.sum'
- name: Run make check
- name: Run just check
run: |
make missing
make bootstrap
make check
just missing
just bootstrap
just check
permissions:
contents: read
id-token: write
23 changes: 13 additions & 10 deletions .github/workflows/test-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,23 @@ jobs:
runs-on: ${{matrix.os}}
timeout-minutes: 20
steps:
- uses: extractions/setup-just@dd310ad5a97d8e7b41793f8ef055398d51ad4de6 # v2.0.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
cache: ${{ contains(runner.name, 'Github Actions') }}
go-version-file: .go-version
cache-dependency-path: '**/go.sum'
- name: Run make dev
- name: Run just dev
run: |
make bootstrap
make dev
just bootstrap
just dev
tests-api:
needs: [checks]
runs-on: custom-linux-xl-nomad-22.04
timeout-minutes: 8
steps:
- uses: extractions/setup-just@dd310ad5a97d8e7b41793f8ef055398d51ad4de6 # v2.0.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
Expand All @@ -83,10 +85,10 @@ jobs:
env:
GOTEST_MOD: api
run: |
make bootstrap
make generate-all
just bootstrap
just generate-all
sudo sed -i 's!Defaults!#Defaults!g' /etc/sudoers
sudo -E env "PATH=$PATH" make test-nomad-module
sudo -E env "PATH=$PATH" just test-nomad-sub "$GOTEST_MOD"
tests-groups:
needs: [checks]
runs-on: ubuntu-22.04
Expand All @@ -101,6 +103,7 @@ jobs:
- drivers
- quick
steps:
- uses: extractions/setup-just@dd310ad5a97d8e7b41793f8ef055398d51ad4de6 # v2.0.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
Expand All @@ -114,13 +117,13 @@ jobs:
env:
GOTEST_GROUP: ${{matrix.groups}}
run: |
make bootstrap
make generate-all
make dev
just bootstrap
just generate-all
just dev
sudo -E env "PATH=$PATH" hc-install install -version ${{env.VAULT_VERSION}} -path '${{env.GOPATH}}/bin' vault
sudo -E env "PATH=$PATH" hc-install install -version ${{env.CONSUL_VERSION}} -path '${{env.GOPATH}}/bin' consul
sudo sed -i 's!Defaults!#Defaults!g' /etc/sudoers
sudo -E env "PATH=$PATH" make test-nomad
sudo -E env "PATH=$PATH" just test-nomad "$GOTEST_GROUP"
permissions:
contents: read
id-token: write
Loading

0 comments on commit 7336b08

Please sign in to comment.