ci: install Go and sqlc as binaries instead of through actions
The runners are ephemeral and clone every action from GitHub, which took several minutes per job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
d4c8fd1d42
commit
db8bdb3a62
1 file changed
+30
-22
+30
-22
@@ -19,19 +19,23 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-go@v7
|
# The runners are ephemeral and clone every action from GitHub, which
|
||||||
with:
|
# takes minutes; Go comes as a tarball instead, and the job image
|
||||||
go-version-file: go.mod
|
# already has the Node version the frontend build needs.
|
||||||
- uses: actions/setup-node@v6
|
- name: Install Go
|
||||||
with:
|
run: |
|
||||||
node-version: 24
|
v="$(awk '/^go /{print $2}' go.mod)"
|
||||||
cache: npm
|
curl -fsSL "https://go.dev/dl/go${v}.linux-amd64.tar.gz" | tar -C /usr/local -xz
|
||||||
|
echo /usr/local/go/bin >> "$GITHUB_PATH"
|
||||||
|
echo "$HOME/go/bin" >> "$GITHUB_PATH"
|
||||||
- name: Build frontend
|
- name: Build frontend
|
||||||
run: npm ci --no-audit --no-fund && npm run build
|
run: npm ci --no-audit --no-fund && npm run build
|
||||||
- name: Generated code is up to date
|
- name: Generated code is up to date
|
||||||
run: |
|
run: |
|
||||||
go tool templ generate
|
go tool templ generate
|
||||||
go run github.com/sqlc-dev/sqlc/cmd/sqlc@${SQLC_VERSION} generate
|
# The release binary avoids compiling sqlc's cgo parser.
|
||||||
|
curl -fsSL "https://github.com/sqlc-dev/sqlc/releases/download/${SQLC_VERSION}/sqlc_${SQLC_VERSION#v}_linux_amd64.tar.gz" | tar -xz -C /usr/local/bin sqlc
|
||||||
|
sqlc generate
|
||||||
git diff --exit-code -- '*.go'
|
git diff --exit-code -- '*.go'
|
||||||
- name: gofmt
|
- name: gofmt
|
||||||
run: test -z "$(gofmt -l internal cmd)" || { gofmt -l internal cmd; exit 1; }
|
run: test -z "$(gofmt -l internal cmd)" || { gofmt -l internal cmd; exit 1; }
|
||||||
@@ -56,13 +60,15 @@ jobs:
|
|||||||
UPTIME_TEST_REDIS_URL: redis://redis:6379/15
|
UPTIME_TEST_REDIS_URL: redis://redis:6379/15
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-go@v7
|
# The runners are ephemeral and clone every action from GitHub, which
|
||||||
with:
|
# takes minutes; Go comes as a tarball instead, and the job image
|
||||||
go-version-file: go.mod
|
# already has the Node version the frontend build needs.
|
||||||
- uses: actions/setup-node@v6
|
- name: Install Go
|
||||||
with:
|
run: |
|
||||||
node-version: 24
|
v="$(awk '/^go /{print $2}' go.mod)"
|
||||||
cache: npm
|
curl -fsSL "https://go.dev/dl/go${v}.linux-amd64.tar.gz" | tar -C /usr/local -xz
|
||||||
|
echo /usr/local/go/bin >> "$GITHUB_PATH"
|
||||||
|
echo "$HOME/go/bin" >> "$GITHUB_PATH"
|
||||||
- name: Build frontend
|
- name: Build frontend
|
||||||
run: npm ci --no-audit --no-fund && npm run build
|
run: npm ci --no-audit --no-fund && npm run build
|
||||||
- name: Prepare database
|
- name: Prepare database
|
||||||
@@ -78,13 +84,15 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-go@v7
|
# The runners are ephemeral and clone every action from GitHub, which
|
||||||
with:
|
# takes minutes; Go comes as a tarball instead, and the job image
|
||||||
go-version-file: go.mod
|
# already has the Node version the frontend build needs.
|
||||||
- uses: actions/setup-node@v6
|
- name: Install Go
|
||||||
with:
|
run: |
|
||||||
node-version: 24
|
v="$(awk '/^go /{print $2}' go.mod)"
|
||||||
cache: npm
|
curl -fsSL "https://go.dev/dl/go${v}.linux-amd64.tar.gz" | tar -C /usr/local -xz
|
||||||
|
echo /usr/local/go/bin >> "$GITHUB_PATH"
|
||||||
|
echo "$HOME/go/bin" >> "$GITHUB_PATH"
|
||||||
- name: Build frontend
|
- name: Build frontend
|
||||||
run: npm ci --no-audit --no-fund && npm run build
|
run: npm ci --no-audit --no-fund && npm run build
|
||||||
- name: Build binaries
|
- name: Build binaries
|
||||||
|
|||||||
Reference in new issue
Block a user