frankenphp/.github/workflows/tests.yaml

72 lines
1.6 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']
2024-01-23 00:49:29 +00:00
env:
GOEXPERIMENT: cgocheck2
steps:
2023-10-05 09:54:33 +00:00
-
uses: actions/checkout@v4
-
uses: actions/setup-go@v5
with:
2024-02-12 09:00:46 +00:00
go-version: '1.22'
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
2024-01-23 00:49:29 +00:00
run: go build
-
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 ./...
-
name: Build the server
working-directory: caddy/frankenphp/
run: go build
-
name: Start the server
working-directory: testdata/
run: sudo ../caddy/frankenphp/frankenphp start
-
name: Run integrations tests
run: ./reload_test.sh
2023-12-01 16:26:21 +00:00
-
name: Lint Go code
uses: golangci/golangci-lint-action@v4
2023-12-01 16:26:21 +00:00
with:
version: latest