-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: refactor CI to use central flow definition
- Loading branch information
Showing
9 changed files
with
200 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
name: Compose Workflow | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_call: | ||
|
||
jobs: | ||
compose: | ||
# Deduplicate jobs from pull requests and branch pushes within the same repo. | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
|
@@ -27,13 +24,14 @@ jobs: | |
- name: Upload Test Subgraph schema | ||
uses: actions/[email protected] | ||
with: | ||
name: test-schema | ||
name: test-compose-schema | ||
path: test-schema.graphql | ||
|
||
- name: Compose Supergraph | ||
uses: ./workflows/compose | ||
with: | ||
name: test | ||
routing-url: https://example.com/graphql | ||
subgraph-schema-artifact: test-schema | ||
subgraph-schema-artifact: test-compose-schema | ||
subgraph-schema-filename: test-schema.graphql | ||
supergraph-schema-artifact: compose-supergraph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Generate Supergraph Schema | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
generate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Rover CLI | ||
run: | | ||
curl -sSL https://rover.apollo.dev/nix/latest | sh | ||
echo "$HOME/.rover/bin" >> $GITHUB_PATH | ||
- name: Checkout Source | ||
uses: actions/[email protected] | ||
|
||
- name: Compose Supergraph Schema | ||
run: > | ||
rover supergraph compose | ||
--config supergraph-config.yaml | ||
--elv2-license=accept | ||
> supergraph.graphql | ||
- name: Upload New Schema Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: supergraph.graphql | ||
path: supergraph.graphql | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Publish Supergraph Schema | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
publish: | ||
type: boolean | ||
required: true | ||
default: false | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout source | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Helm | ||
uses: azure/[email protected] | ||
|
||
- name: Download Schema Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: supergraph.graphql | ||
path: charts/supergraph | ||
|
||
- name: Package Chart | ||
run: | | ||
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) | ||
helm package charts/supergraph --version $LATEST_TAG | ||
- name: Generate Image Name | ||
run: echo IMAGE_REPOSITORY=oci://ghcr.io/$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]' | tr '[_]' '[\-]') >> $GITHUB_ENV | ||
|
||
- name: Log in to GitHub Docker Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish Chart | ||
if: ${{ inputs.publish }} | ||
run: helm push $(ls supergraph-*.tgz) ${{ env.IMAGE_REPOSITORY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
name: Update Workflow | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_call: | ||
secrets: | ||
GRAPH_FEDERATOR: | ||
required: true | ||
|
||
jobs: | ||
update: | ||
# Deduplicate jobs from pull requests and branch pushes within the same repo. | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
|
@@ -27,16 +27,17 @@ jobs: | |
- name: Upload Test Subgraph schema | ||
uses: actions/[email protected] | ||
with: | ||
name: test-schema | ||
name: test-update-schema | ||
path: test-schema.graphql | ||
|
||
- name: Update Supergraph | ||
uses: ./workflows/update | ||
with: | ||
name: test | ||
routing-url: https://example.com/graphql | ||
subgraph-schema-artifact: test-schema | ||
subgraph-schema-artifact: test-update-schema | ||
subgraph-schema-filename: test-schema.graphql | ||
supergraph-schema-artifact: update-supergraph | ||
github-app-id: 1010045 | ||
github-app-private-key: ${{ secrets.GRAPH_FEDERATOR }} | ||
publish: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
helm_lint: | ||
# Deduplicate jobs from pull requests and branch pushes within the same repo. | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | ||
uses: ./.github/workflows/_helm_lint.yaml | ||
|
||
supergraph_generate: | ||
# Deduplicate jobs from pull requests and branch pushes within the same repo. | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | ||
uses: ./.github/workflows/_supergraph_generate.yaml | ||
|
||
supergraph_publish: | ||
# Deduplicate jobs from pull requests and branch pushes within the same repo. | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | ||
needs: | ||
- helm_lint | ||
- supergraph_generate | ||
uses: ./.github/workflows/_supergraph_publish.yaml | ||
permissions: | ||
contents: read | ||
packages: write | ||
with: | ||
publish: ${{ needs.release_please.outputs.supergraph-chart-released == 'true' }} | ||
|
||
compose_workflow: | ||
# Deduplicate jobs from pull requests and branch pushes within the same repo. | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | ||
uses: ./.github/workflows/_compose_workflow.yaml | ||
|
||
update_workflow: | ||
# Deduplicate jobs from pull requests and branch pushes within the same repo. | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | ||
uses: ./.github/workflows/_update_workflow.yaml | ||
secrets: | ||
GRAPH_FEDERATOR: ${{ secrets.GRAPH_FEDERATOR }} | ||
|
||
docs: | ||
# Deduplicate jobs from pull requests and branch pushes within the same repo. | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | ||
uses: ./.github/workflows/_docs.yaml | ||
permissions: | ||
pages: write | ||
id-token: write | ||
with: | ||
publish: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.