frankenphp/.github/workflows/tests.yaml

61 lines
1.3 KiB
YAML
Raw Normal View History

2023-12-01 16:26:21 +00:00
---
name: Tests
2023-10-05 09:54:33 +00:00
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
tests:
runs-on: ubuntu-latest
strategy:
2023-10-05 09:54:33 +00:00
fail-fast: false
matrix:
php-versions: ['8.2', '8.3']
steps:
2023-10-05 09:54:33 +00:00
-
uses: actions/checkout@v4
-
uses: actions/setup-go@v4
with:
2023-08-23 09:33:45 +00:00
go-version: '1.21'
2023-09-14 16:28:31 +00:00
cache-dependency-path: |
go.sum
caddy/go.sum
2023-10-05 09:54:33 +00:00
-
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
ini-file: development
2023-07-04 14:54:40 +00:00
coverage: none
2023-10-05 09:54:33 +00:00
tools: none
env:
phpts: ts
2023-10-05 09:54:33 +00:00
-
name: Set CGO flags
run: |
echo "CGO_CFLAGS=$(php-config --includes)" >> "$GITHUB_ENV"
-
name: Build
2023-08-23 09:33:45 +00:00
run: go build
env:
GOEXPERIMENT: cgocheck2
-
name: Build testcli binary
working-directory: internal/testcli/
run: go build
2023-10-05 09:54:33 +00:00
-
name: Run library tests
run: go test -race -v ./...
2023-10-05 09:54:33 +00:00
-
name: Run Caddy module tests
working-directory: caddy/
run: go test -race -v ./...
2023-12-01 16:26:21 +00:00
-
name: Lint Go code
uses: golangci/golangci-lint-action@v3
with:
version: latest