frankenphp/.github/workflows/tests.yaml

81 lines
1.8 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
paths-ignore:
- 'docs/**'
2023-10-05 09:54:33 +00:00
push:
branches:
- main
paths-ignore:
- 'docs/**'
2024-08-04 12:05:54 +00:00
permissions:
contents: read
jobs:
tests:
runs-on: ubuntu-latest
strategy:
2023-10-05 09:54:33 +00:00
fail-fast: false
matrix:
2024-08-12 20:26:19 +00:00
php-versions: ['8.2', '8.3', '8.4']
2024-01-23 00:49:29 +00:00
env:
GOEXPERIMENT: cgocheck2
GOMAXPROCS: 10
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
2024-05-21 08:50:34 +00:00
debug: true
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@v6
2024-05-21 08:50:34 +00:00
if: matrix.php-versions == '8.3'
2023-12-01 16:26:21 +00:00
with:
version: latest