Skip to content

Commit

Permalink
Add sqlc to build pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
Piszmog committed Apr 7, 2024
1 parent 20edfd1 commit f1dac9b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ jobs:
- run: go mod download
- run: go install github.com/a-h/templ/cmd/[email protected]
- run: make generate-templ
- uses: sqlc-dev/setup-sqlc@v3
with:
sqlc-version: '1.26.0'
- run: sqlc vet
- run: sqlc generate
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
Expand All @@ -36,5 +41,9 @@ jobs:
- run: go mod download
- run: go install github.com/a-h/templ/cmd/[email protected]
- run: make generate-templ
- uses: sqlc-dev/setup-sqlc@v3
with:
sqlc-version: '1.26.0'
- run: sqlc generate
- name: Test
run: go test -race ./...
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ jobs:
chmod +x tailwindcss-linux-x64
mv tailwindcss-linux-x64 tailwindcss
./tailwindcss -i ./styles/input.css -o ./dist/assets/css/output@${{ github.event.inputs.version }}.css --minify
- uses: sqlc-dev/setup-sqlc@v3
with:
sqlc-version: '1.26.0'
- run: sqlc generate
- name: Build Application
run: go build -o ./app -ldflags="-s -w -X version.Value=${{ github.event.inputs.version }}"
- name: Create Tag
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ RUN curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/downlo
&& chmod +x tailwindcss-linux-x64 \
&& mv tailwindcss-linux-x64 /usr/local/bin/tailwindcss

RUN go install github.com/a-h/templ/cmd/[email protected]
RUN go install github.com/a-h/templ/cmd/[email protected] \
&& go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest

WORKDIR /app

COPY ./ /app

RUN templ generate -path ./components \
&& tailwindcss -i ./styles/input.css -o ./dist/assets/css/output@${VERSION}.css --minify
&& tailwindcss -i ./styles/input.css -o ./dist/assets/css/output@${VERSION}.css --minify \
&& sqlc generate

RUN go build -ldflags="-s -w -X version.Value=${VERSION}" -o my-app

Expand Down

0 comments on commit f1dac9b

Please sign in to comment.