* `golangci-lint`: Lint with `integration` & `wporg_live` build tags * Run `gofmt` via `golangci-lint` * Remove standalone `go vet` `go vet` is ran by `golangci-lint`. Thus, it does not need to be ran separately.
76 lines
2 KiB
YAML
76 lines
2 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
golangci-lint:
|
|
name: GolangCI-Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
- name: Install Tailwind CSS
|
|
run: |
|
|
mkdir -p bin
|
|
curl -sL https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64 -o bin/tailwindcss
|
|
chmod +x bin/tailwindcss
|
|
- name: Build CSS
|
|
run: make tailwind
|
|
- name: Install golangci-lint
|
|
run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
|
|
- name: Lint
|
|
run: golangci-lint run ./...
|
|
|
|
go-mod-tidy:
|
|
name: Go Modules Tidy
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
- name: Check if go.mod/go.sum are tidy
|
|
run: go mod tidy -diff
|
|
|
|
test:
|
|
name: Go Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
- name: Install Tailwind CSS
|
|
run: |
|
|
mkdir -p bin
|
|
curl -sL https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64 -o bin/tailwindcss
|
|
chmod +x bin/tailwindcss
|
|
- name: Build CSS
|
|
run: make tailwind
|
|
- name: Test
|
|
run: go test -v ./...
|
|
|
|
integration:
|
|
name: Integration Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
- uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: "8.2"
|
|
tools: composer:v2
|
|
- name: Create stub CSS for embed
|
|
run: touch internal/http/static/assets/styles/app.css
|
|
- name: Integration Test
|
|
run: go test -tags=integration -count=1 -timeout=5m -v ./internal/integration/...
|