mirror of https://github.com/open-feature/cli.git
66 lines
1.5 KiB
YAML
66 lines
1.5 KiB
YAML
name: PR Test
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
merge_group:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
name: test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
|
|
- name: Run tests
|
|
run: go test ./...
|
|
|
|
docs-check:
|
|
name: Validate docs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
|
|
- run: make generate-docs
|
|
- name: Check no diff
|
|
run: |
|
|
if [ ! -z "$(git status --porcelain)" ]; then
|
|
echo "::error file=Makefile::Doc generation produced diff. Run 'make generate-docs' and commit results."
|
|
git diff
|
|
exit 1
|
|
fi
|
|
|
|
integration-tests:
|
|
name: 'Generator Integration Tests'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
|
|
- name: Run all integration tests with Dagger
|
|
uses: dagger/dagger-for-github@b81317a976cb7f7125469707321849737cd1b3bc # v7
|
|
with:
|
|
workdir: .
|
|
verb: run
|
|
args: go run ./test/integration/cmd/run.go
|
|
version: 'latest'
|