Skip to content

fix: allow for custom URL and inital testing #7

fix: allow for custom URL and inital testing

fix: allow for custom URL and inital testing #7

Workflow file for this run

# Copyright (c) Materialize Inc.
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
- run: go mod download
- run: go build -v .
- name: Run linters
uses: golangci/golangci-lint-action@v4
with:
version: latest
generate:
name: Generate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
- run: go generate ./...
- name: git diff
run: |
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1)
test:
name: Unit Tests
needs: build
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
- run: go mod download
- run: go test -v -cover ./...
timeout-minutes: 10
# Acceptance tests run against real Ory API
# Only runs on main branch or when manually triggered
acceptance:
name: Acceptance Tests
needs: build
runs-on: ubuntu-latest
timeout-minutes: 30
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
env:
ORY_WORKSPACE_API_KEY: ${{ secrets.ORY_WORKSPACE_API_KEY }}
ORY_PROJECT_API_KEY: ${{ secrets.ORY_PROJECT_API_KEY }}
ORY_PROJECT_ID: ${{ secrets.ORY_PROJECT_ID }}
ORY_PROJECT_SLUG: ${{ secrets.ORY_PROJECT_SLUG }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
- run: go mod download
- run: TF_ACC=1 go test -v -cover -timeout 30m -p 1 ./...
timeout-minutes: 25