Skip to content

Commit 3f7561a

Browse files
authored
Merge pull request #2 from ory/fix/staging-project-api-url
fix: allow for custom URL and inital testing
2 parents dbe3af4 + fc50fdc commit 3f7561a

File tree

41 files changed

+2889
-663
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2889
-663
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Acceptance Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
inputs:
8+
run_all:
9+
description: 'Run all tests'
10+
required: false
11+
default: true
12+
type: boolean
13+
enable_keto_tests:
14+
description: 'Keto/relationship tests'
15+
required: false
16+
default: false
17+
type: boolean
18+
enable_b2b_tests:
19+
description: 'B2B/organization tests'
20+
required: false
21+
default: false
22+
type: boolean
23+
enable_social_provider_tests:
24+
description: 'Social provider tests'
25+
required: false
26+
default: false
27+
type: boolean
28+
enable_schema_tests:
29+
description: 'Identity schema tests'
30+
required: false
31+
default: false
32+
type: boolean
33+
enable_project_tests:
34+
description: 'Project create/delete tests'
35+
required: false
36+
default: false
37+
type: boolean
38+
39+
permissions:
40+
contents: read
41+
pull-requests: read
42+
43+
jobs:
44+
detect-changes:
45+
name: Detect Changes
46+
runs-on: ubuntu-slim
47+
outputs:
48+
source-changed: ${{ steps.filter.outputs.source }}
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v4
52+
53+
- uses: dorny/paths-filter@v3
54+
id: filter
55+
with:
56+
filters: |
57+
source:
58+
- '**.go'
59+
- 'go.mod'
60+
- 'go.sum'
61+
- '.github/workflows/acceptance-test.yml'
62+
63+
acceptance-test:
64+
name: Build & Acceptance Test
65+
needs: detect-changes
66+
if: ${{ needs.detect-changes.outputs.source-changed == 'true' || github.event_name == 'workflow_dispatch' }}
67+
runs-on: ubuntu-slim
68+
timeout-minutes: 30
69+
70+
env:
71+
ORY_WORKSPACE_API_KEY: ${{ secrets.ORY_WORKSPACE_API_KEY }}
72+
ORY_WORKSPACE_ID: ${{ secrets.ORY_WORKSPACE_ID }}
73+
ORY_CONSOLE_API_URL: ${{ secrets.ORY_CONSOLE_API_URL }}
74+
ORY_PROJECT_API_URL: ${{ secrets.ORY_PROJECT_API_URL }}
75+
76+
steps:
77+
- name: Checkout
78+
uses: actions/checkout@v4
79+
80+
- name: Setup Go
81+
uses: actions/setup-go@v5
82+
with:
83+
go-version-file: 'go.mod'
84+
cache: true
85+
86+
- name: Install dependencies
87+
run: make deps-ci
88+
89+
- name: Run Acceptance Tests
90+
env:
91+
ORY_KETO_TESTS_ENABLED: ${{ github.event_name == 'push' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_keto_tests == 'true' }}
92+
ORY_B2B_ENABLED: ${{ github.event_name == 'push' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_b2b_tests == 'true' }}
93+
ORY_SOCIAL_PROVIDER_TESTS_ENABLED: ${{ github.event_name == 'push' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_social_provider_tests == 'true' }}
94+
ORY_SCHEMA_TESTS_ENABLED: ${{ github.event_name == 'push' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_schema_tests == 'true' }}
95+
ORY_PROJECT_TESTS_ENABLED: ${{ github.event_name == 'push' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_project_tests == 'true' }}
96+
run: ./scripts/run-acceptance-tests.sh -v -timeout 20m ./...

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212

1313
jobs:
1414
goreleaser:
15-
runs-on: ubuntu-latest
15+
runs-on: ubuntu-slim
1616
steps:
1717
- uses: actions/checkout@v4
1818
with:

.github/workflows/test.yml

Lines changed: 0 additions & 83 deletions
This file was deleted.

.github/workflows/unit-test.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Unit Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
pull-requests: read
12+
13+
jobs:
14+
detect-changes:
15+
name: Detect Changes
16+
runs-on: ubuntu-slim
17+
outputs:
18+
source-changed: ${{ steps.filter.outputs.source }}
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- uses: dorny/paths-filter@v3
24+
id: filter
25+
with:
26+
filters: |
27+
source:
28+
- '**.go'
29+
- 'go.mod'
30+
- 'go.sum'
31+
- '.github/workflows/unit-test.yml'
32+
33+
unit-test:
34+
name: Build & Unit Test
35+
needs: detect-changes
36+
if: ${{ needs.detect-changes.outputs.source-changed == 'true' }}
37+
runs-on: ubuntu-slim
38+
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
43+
- name: Setup Go
44+
uses: actions/setup-go@v5
45+
with:
46+
go-version-file: 'go.mod'
47+
cache: true
48+
49+
- name: Run Unit Tests
50+
run: go test -short -v -cover ./...

0 commit comments

Comments
 (0)