ci: lint, tests against TimescaleDB and Redis, binaries and image #81

Merged
Sebi merged 3 commits from ci/pipeline into main 2026-11-22 12:51:42 +00:00
Showing only changes of commit db8bdb3a62 - Show all commits
+30 -22
View File
@@ -19,19 +19,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
# The runners are ephemeral and clone every action from GitHub, which
# takes minutes; Go comes as a tarball instead, and the job image
# already has the Node version the frontend build needs.
- name: Install Go
run: |
v="$(awk '/^go /{print $2}' go.mod)"
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
run: npm ci --no-audit --no-fund && npm run build
- name: Generated code is up to date
run: |
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'
- name: gofmt
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
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
# The runners are ephemeral and clone every action from GitHub, which
# takes minutes; Go comes as a tarball instead, and the job image
# already has the Node version the frontend build needs.
- name: Install Go
run: |
v="$(awk '/^go /{print $2}' go.mod)"
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
run: npm ci --no-audit --no-fund && npm run build
- name: Prepare database
@@ -78,13 +84,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
# The runners are ephemeral and clone every action from GitHub, which
# takes minutes; Go comes as a tarball instead, and the job image
# already has the Node version the frontend build needs.
- name: Install Go
run: |
v="$(awk '/^go /{print $2}' go.mod)"
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
run: npm ci --no-audit --no-fund && npm run build
- name: Build binaries