Add delivery by button #262
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
check-dependencies: | |
name: Check dependencies with nancy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-go@v2 | |
- name: WriteGoList | |
run: go list -json -m all > go.list | |
- name: Nancy | |
uses: sonatype-nexus-community/nancy-github-action@main | |
continue-on-error: true | |
lint-code: | |
name: Lint with golangci-lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- name: golangci-lint | |
uses: reviewdog/action-golangci-lint@v2 | |
with: | |
go_version: 1.23 | |
lint-oapi: | |
name: Run Spectral | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: stoplightio/spectral-action@latest | |
with: | |
file_glob: 'api/.yaml' | |
spectral_ruleset: "configs/spectral/spectral.yaml" | |
test: | |
name: Run Tests | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:16.4 | |
env: | |
POSTGRES_DB: ctf01d_training_platform_test | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
PGPORT: 4112 | |
ports: | |
- 4112:4112 | |
options: >- | |
--health-cmd="pg_isready -U postgres" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=5 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: '1.23' | |
- name: Install Dependencies | |
run: make install | |
- name: Wait for PostgreSQL | |
run: until pg_isready -h localhost -p 4112 -U postgres; do sleep 1; done | |
- name: Run Tests | |
env: | |
DATABASE_URL: postgres://postgres:postgres@localhost:4112/ctf01d_training_platform_test?sslmode=disable | |
run: go test -v ./test/server_integration_test.go |