Skip to content

feat: profile page #798

feat: profile page

feat: profile page #798

Workflow file for this run

name: Backend CI
on:
push:
branches:
- main
paths:
- "backend/**"
- ".github/workflows/BackendCI.yaml"
pull_request:
branches:
- main
paths:
- "backend/**"
- ".github/workflows/BackendCI.yaml"
permissions:
contents: read
checks: write
pull-requests: write
jobs:
secrets-scan:
name: Secrets Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: TruffleHog secrets scan
uses: trufflesecurity/trufflehog@main
with:
extra_args: --only-verified
backend-lint:
name: Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: './backend/go.mod'
cache: true
cache-dependency-path: './backend/go.sum'
- name: Install swag
run: go install github.com/swaggo/swag/cmd/swag@latest
- name: Generate swagger docs
run: make swagger
- name: Check code formatting
run: |
gofmt_files=$(gofmt -l .)
if [ -n "$gofmt_files" ]; then
echo "The following files are not gofmt'd:"
echo "$gofmt_files"
exit 1
fi
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
working-directory: ./backend
args: --timeout=5m
backend-test:
name: Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-go@v5
with:
go-version-file: './backend/go.mod'
cache: true
cache-dependency-path: './backend/go.sum'
- name: Install swag
run: go install github.com/swaggo/swag/cmd/swag@latest
- name: Generate swagger docs
run: make swagger
- name: Run tests with coverage
run: go test -coverprofile=coverage.out ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.out
flags: backend
backend-build:
name: Build
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: './backend/go.mod'
cache: true
cache-dependency-path: './backend/go.sum'
- name: Install swag
run: go install github.com/swaggo/swag/cmd/swag@latest
- name: Generate swagger docs
run: make swagger
- name: Verify go.mod is tidy
run: |
go mod tidy
git diff --exit-code go.mod go.sum
- name: Build application
run: make build
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: selfserve-binary
path: backend/bin/selfserve
retention-days: 7