Skip to content

Commit be7d676

Browse files
authored
fix: update federation PR workflows to check out correct codebase (#1671)
1 parent 5149be9 commit be7d676

File tree

5 files changed

+65
-59
lines changed

5 files changed

+65
-59
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,8 @@ jobs:
2020
needs: build-libraries
2121
uses: ./.github/workflows/build-examples.yml
2222

23-
federation-composition:
24-
needs: build-libraries
25-
uses: ./.github/workflows/federation-composition.yml
26-
27-
federation-compatibility:
28-
needs: build-libraries
29-
uses: ./.github/workflows/federation-compatibility.yml
23+
federation-integration:
24+
uses: ./.github/workflows/federation-integration.yml
3025
secrets:
3126
token: ${{ secrets.GITHUB_TOKEN }}
3227

.github/workflows/federation-compatibility.yml

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

.github/workflows/federation-composition.yml renamed to .github/workflows/federation-integration.yml

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
1-
name: Federation Composition Test
1+
name: Federation Integration Tests
22

33
on:
44
workflow_call:
5+
inputs:
6+
fork:
7+
default: false
8+
type: boolean
9+
secrets:
10+
token:
11+
required: true
512

613
jobs:
7-
federation-composition-test:
14+
composition:
815
timeout-minutes: 30
916
runs-on: ubuntu-latest
1017
defaults:
1118
run:
1219
working-directory: examples/federation
1320

1421
steps:
15-
- uses: actions/checkout@v3
22+
- name: Checkout Repository
23+
if: ${{ inputs.fork }} == false
24+
uses: actions/checkout@v3
25+
- name: Checkout Repository (fork mode)
26+
if: ${{ inputs.fork }} == true
27+
uses: actions/checkout@v3
28+
with:
29+
ref: ${{ github.event.pull_request.head.sha }}
1630

1731
- name: Set up Java 17
1832
uses: actions/setup-java@v3
@@ -63,3 +77,45 @@ jobs:
6377
- name: Stop Supergraph
6478
if: ${{ always() }}
6579
run: docker compose down --remove-orphans
80+
81+
compatibility:
82+
timeout-minutes: 30
83+
runs-on: ubuntu-latest
84+
defaults:
85+
run:
86+
working-directory: integration/federation-compatibility
87+
88+
steps:
89+
- name: Checkout Repository
90+
if: ${{ inputs.fork }} == false
91+
uses: actions/checkout@v3
92+
- name: Checkout Repository (fork mode)
93+
if: ${{ inputs.fork }} == true
94+
uses: actions/checkout@v3
95+
with:
96+
ref: ${{ github.event.pull_request.head.sha }}
97+
98+
- name: Validate Gradle wrapper
99+
uses: gradle/wrapper-validation-action@v1
100+
101+
- name: Set up Java 17
102+
uses: actions/setup-java@v3
103+
with:
104+
java-version: 17
105+
distribution: 'zulu'
106+
107+
- name: Set up Gradle cache
108+
uses: gradle/gradle-build-action@v2
109+
110+
- name: Build compatibility app with Gradle
111+
run: ./gradlew bootJar graphqlGenerateSDL
112+
113+
- name: Compatibility Test
114+
uses: apollographql/federation-subgraph-compatibility@v1
115+
with:
116+
compose: 'integration/federation-compatibility/docker-compose.yaml'
117+
schema: 'integration/federation-compatibility/build/schema.graphql'
118+
debug: true
119+
token: ${{ secrets.token }}
120+
failOnWarning: true
121+
failOnRequired: true

.github/workflows/pr-check-federation.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ on:
99
- 'integration/federation-compatibility/**'
1010

1111
jobs:
12-
federation-compatibility:
13-
uses: ./.github/workflows/federation-compatibility.yml
12+
federation-integration:
13+
uses: ./.github/workflows/federation-integration.yml
14+
with:
15+
fork: true
1416
secrets:
1517
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}

.github/workflows/pr-check.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,3 @@ jobs:
2020
build-examples:
2121
needs: build-libraries
2222
uses: ./.github/workflows/build-examples.yml
23-
24-
federation-composition:
25-
needs: build-libraries
26-
uses: ./.github/workflows/federation-composition.yml

0 commit comments

Comments
 (0)