Skip to content

Merge pull request #14 from naohito-T/feature/logger #38

Merge pull request #14 from naohito-T/feature/logger

Merge pull request #14 from naohito-T/feature/logger #38

Workflow file for this run

name: Test Backend
on:
push:
paths:
- "backend/**"
- ".github/workflows/test_backend.yml"
- '!**.md'
defaults:
run:
working-directory: backend
jobs:
setup-go-modules-backend:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
id: setup-go
with:
go-version-file: "backend/go.mod"
cache-dependency-path: "backend/go.sum"
lint-backend:
needs: setup-go-modules-backend
permissions:
contents: read
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
id: setup-go
with:
go-version-file: "backend/go.mod"
cache-dependency-path: "backend/go.sum"
- name: Check golangci-lint
uses: golangci/golangci-lint-action@v5
with:
version: v1.54
working-directory: backend
build-backend:
needs: setup-go-modules-backend
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
id: setup-go
with:
go-version-file: "backend/go.mod"
cache-dependency-path: "backend/go.sum"
- name: Check Build API entrypoint
run: GOARCH=arm64 GOOS=linux go build -ldflags="-s -w" cmd/api/main.go
test-backend:
needs: setup-go-modules-backend
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
id: setup-go
with:
go-version-file: "backend/go.mod"
cache-dependency-path: "backend/go.sum"
- name: Check test
run: make test