Skip to content

backend urlをenvに追加 #17

backend urlをenvに追加

backend urlをenvに追加 #17

Workflow file for this run

name: CI
on:
push:
permissions:
id-token: write
contents: read
pull-requests: read
env:
GO_VERSION: 1.23.2
PNPM_VERSION: 9.12.2
NODE_VERSION: 20.9.0
jobs:
filter:
runs-on: ubuntu-latest
outputs:
frontend: ${{ steps.frontend.outputs.frontend }}
spec: ${{ steps.spec.outputs.spec }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
frontend:
- "frontend/**"
- ".github/workflows/ci.yaml"
spec:
- "spec/**"
- ".github/workflows/ci.yaml"
go-test:
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: auth
ports:
- 5432:5432
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-server
with:
go-version: ${{ env.GO_VERSION }}
- run: go test ./...
- name: Build test
run: go build cmd/main.go
go-generate:
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: auth
ports:
- 5432:5432
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-server
with:
go-version: ${{ env.GO_VERSION }}
- run: go generate ./...
- name: Check diff
run: git diff --exit-code
go-fmt:
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: auth
ports:
- 5432:5432
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-server
with:
go-version: ${{ env.GO_VERSION }}
- name: Check format
run: go fmt ./...
front-test:
runs-on: ubuntu-latest
needs: filter
if: ${{ needs.filter.outputs.frontend == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION}}
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"
- run: cd frontend && pnpm install
- run: cd frontend && pnpm test