ci: move sdk generation to the top
@@ -31,9 +31,25 @@ jobs:
- name: Run tests
run: ./test/conformance/test.sh -v -short -parallel 16
+ sdk-generate:
+ name: Generate SDKs
+ runs-on: ubuntu-latest
+ outputs:
+ sdk-cache-key: ${{ steps.sdk-generate.outputs.sdk-cache-key }}
+ steps:
+ - uses: ory/ci/sdk/generate@master
+ with:
+ token: ${{ github.token }}
+ app-name: Ory_Hydra
+ swag-spec-ignore: internal/httpclient gopkg.in/square/go-jose.v2
+ swag-spec-location: spec/api.json
+ id: sdk-generate
+
test:
name: Run tests and lints
runs-on: ubuntu-latest
+ needs:
+ - sdk-generate
services:
postgres:
image: postgres:9.6
@@ -63,6 +79,11 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 2
+ - uses: actions/cache@v2
+ with:
+ path: |
+ internal/httpclient
+ key: ${{ needs.sdk-generate.outputs.sdk-cache-key }}
- uses: actions/setup-go@v2
with:
go-version: ^1.17
@@ -95,6 +116,8 @@ jobs:
test-hsm:
name: Run HSM tests
+ needs:
+ - sdk-generate
runs-on: ubuntu-latest
env:
HSM_ENABLED: true
@@ -103,6 +126,11 @@ jobs:
HSM_PIN: 1234
steps:
- uses: actions/checkout@v2
+ - uses: actions/cache@v2
+ with:
+ path: |
+ internal/httpclient
+ key: ${{ needs.sdk-generate.outputs.sdk-cache-key }}
- uses: actions/setup-go@v2
with:
go-version: ^1.17
@@ -121,6 +149,8 @@ jobs:
setup-e2e:
name: Setup end-to-end tests
+ needs:
+ - sdk-generate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@@ -138,6 +168,7 @@ jobs:
runs-on: ubuntu-latest
needs:
- setup-e2e
+ - sdk-generate
strategy:
matrix:
database: ['memory', 'postgres', 'mysql', 'cockroach']
@@ -176,6 +207,11 @@ jobs:
with:
path: ./test/e2e/hydra
key: ${{ runner.os }}-hydra
+ - uses: actions/cache@v2
+ with:
+ path: |
+ internal/httpclient
+ key: ${{ needs.sdk-generate.outputs.sdk-cache-key }}
- run: ./test/e2e/circle-ci.bash ${{ matrix.database }} ${{ matrix.args }}
docs-build:
@@ -217,22 +253,6 @@ jobs:
with:
token: ${{ github.token }}
- sdk-generate:
- name: Generate SDKs
- runs-on: ubuntu-latest
- if: ${{ github.ref_type == 'tag' || github.ref_name != 'master' || github.event_name == 'pull_request' }}
- needs:
- - test
- - test-hsm
- - test-e2e
- steps:
- - uses: ory/ci/sdk/generate@master
- with:
- token: ${{ github.token }}
- app-name: Ory_Hydra
- swag-spec-ignore: internal/httpclient gopkg.in/square/go-jose.v2
- swag-spec-location: spec/api.json
-
sdk-release:
name: Release SDKs
runs-on: ubuntu-latest
