Skip to content

Commit

Permalink
Fiddle Github Actions around and add logic to select versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanrainer committed Jul 15, 2024
1 parent 994ad2a commit c2c5e5e
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ workflows:
command: [github-actions]
options:
- |
--workflow-name 'tests-mac-x86.yml' --branch "<< pipeline.git.branch >>" --commit-id "<< pipeline.git.revision >>" --inputs '{"composition-versions": "[\"2.8.2\"]", "router-versions": "[\"1.50.0\"]"}'
--workflow-name 'tests-mac-x86.yml' --branch "<< pipeline.git.branch >>" --commit-id "<< pipeline.git.revision >>" --inputs '{"composition-versions": "[\"2.8.2\"]"}'
- xtask:
name: Run supergraph-demo tests (<< matrix.rust_channel >> rust on << matrix.platform >>)
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/fake-smokes.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/run-smokes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
schedule:
- cron: '* 9 * * *'

jobs:
calculate_correct_version_ranges:
runs-on: ubuntu-24.04
outputs:
router_versions: ${{ steps.router-versions.outputs.router_versions }}
supergraph_versions: ${{ steps.supergraph-versions.outputs.supergraph_versions }}
steps:
- run: |
JSON=$(curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/apollographql/router/releases | jq -rc '[.[] | select((.name | contains("-") | not ) and (.name | contains("v")))] | [.[:3].[].name | sub("v";"")]')
echo "router_versions=$JSON" >> "$GITHUB_OUTPUT"
id: "router-versions"
shell: bash
name: "Get latest Router versions"
- run: |
JSON=$(curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/apollographql/federation-rs/releases | jq -rc '[.[] | select((.name | contains("-") | not ) and (.name | contains("supergraph")))] | [.[:3].[].name | sub("supergraph@v";"")]')
echo "supergraph_versions=$JSON" >> "$GITHUB_OUTPUT"
id: "supergraph-versions"
shell: bash
name: "Get latest Supergraph Plugin versions"
run-smokes:
uses: ./.github/workflows/smoke-test.yml
needs: calculate_correct_version_ranges
with:
composition-versions: '${{ needs.calculate_correct_version_ranges.outputs.supergraph_versions }}'
router-versions: '${{ needs.calculate_correct_version_ranges.outputs.router_versions }}'
12 changes: 1 addition & 11 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
on:
workflow_dispatch:
inputs:
composition-versions:
description: 'JSON list of supergraph versions'
required: true
type: string
router-versions:
description: 'JSON list of router versions'
required: true
type: string

workflow_call:
inputs:
composition-versions:
Expand Down Expand Up @@ -76,6 +65,7 @@ jobs:
needs: build_binaries
name: Run smoke tests
strategy:
max-parallel: 8
matrix:
composition-version: ${{ fromJSON(inputs.composition-versions) }}
router-version: ${{ fromJSON(inputs.router-versions) }}
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/tests-mac-x86.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ on:
description: 'JSON list of supergraph versions'
required: true
type: string
router-versions:
description: 'JSON list of router versions'
required: true
type: string

jobs:
build-rover:
name: Build Rover for macOS x86-64
Expand Down Expand Up @@ -71,23 +66,3 @@ jobs:
run: |
chmod +x ./artifact/{rover,xtask}
./artifact/xtask integration-test
smoke-tests:
needs: build-rover
name: Run simple smoke tests on macOS x86-64
strategy:
matrix:
composition-version: ${{ fromJSON(inputs.composition-versions) }}
router-version: ${{ fromJSON(inputs.router-versions) }}
# x86-64 runner
runs-on: macos-13
steps:
- uses: actions/checkout@v4
name: "Checkout rover repo"
- uses: actions/download-artifact@v4
name: "Download artifacts built in previous stages"
- uses: volta-cli/action@v4
name: "Install volta"
- name: Run Smoke Tests
run: |
chmod +x ./artifact/{rover,xtask}
./artifact/xtask smoke --binary-path ./artifact/rover --federation-version "${{ matrix.composition-version }}" --router-version "${{ matrix.router-version }}"

0 comments on commit c2c5e5e

Please sign in to comment.