Skip to content

Commit

Permalink
Add determine-runner job to test.yml
Browse files Browse the repository at this point in the history
New workflows are running on Buildjet runners, however, they
are not available in personal forks and it is useful to run test.yml
in fork, that is why this commit introduces determine-runner job,
which checks if we are in fork and changes runner to ubuntu-2204 which
is available everywhere

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
  • Loading branch information
uncleDecart committed Oct 20, 2023
1 parent 9a5e323 commit 75bd362
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,35 @@ on:
inputs:
eve_image:
type: string
runner:
type: string
default: buildjet-4vcpu-ubuntu-2204
workflow_call:
inputs:
eve_image:
type: string
runner:
type: string
default: buildjet-4vcpu-ubuntu-2204

jobs:
determine-runner:
name: Determine best available runner
runs-on: ubuntu-latest
outputs:
runner: ${{ steps.fork-check.outputs.runner }}
steps:
- id: fork-check
run: |
if ["${{ github.event.repository.full_name}}" == "lf-edge/eve" || "${{ github.event.repository.full_name}}" == "lf-edge/eden"]; then
echo "runner=buildjet-4vcpu-ubuntu-2204" >> "$GITHUB_OUTPUT"
else
echo "runner=ubuntu-2204" >> "$GITHUB_OUTPUT"
fi
smoke:
continue-on-error: true
strategy:
matrix:
file_system: ['ext4', 'zfs']
tpm: [true, false]
name: Smoke tests
runs-on: ${{ inputs.runner }}
needs: determine-runner
runs-on: ${{ determine-runner.outputs.runner }}
steps:
- name: Get code
uses: actions/checkout@v3
Expand All @@ -42,8 +51,8 @@ jobs:

networking:
name: Networking test suite
needs: smoke
runs-on: ${{ inputs.runner }}
needs: [smoke, determine-runner]
runs-on: ${{ determine-runner.outputs.runner }}
steps:
- name: Get code
uses: actions/checkout@v3
Expand All @@ -64,8 +73,8 @@ jobs:
matrix:
file_system: ['ext4', 'zfs']
name: Storage test suite
needs: smoke
runs-on: ${{ inputs.runner }}
needs: [smoke, determine-runner]
runs-on: ${{ determine-runner.outputs.runner }}
steps:
- name: Get code
uses: actions/checkout@v3
Expand All @@ -82,8 +91,8 @@ jobs:

lpc-loc:
name: LPC LOC test suite
needs: smoke
runs-on: ${{ inputs.runner }}
needs: [smoke, determine-runner]
runs-on: ${{ determine-runner.outputs.runner }}
steps:
- name: Get code
uses: actions/checkout@v3
Expand All @@ -104,8 +113,8 @@ jobs:
matrix:
file_system: ['ext4', 'zfs']
name: EVE upgrade test suite
needs: smoke
runs-on: ${{ inputs.runner }}
needs: [smoke, determine-runner]
runs-on: ${{ determine-runner.outputs.runner }}
steps:
- name: Get code
uses: actions/checkout@v3
Expand All @@ -122,8 +131,8 @@ jobs:

user-apps:
name: User apps test suite
needs: smoke
runs-on: ${{ inputs.runner }}
needs: [smoke, determine-runner]
runs-on: ${{ determine-runner.outputs.runner }}
steps:
- name: Get code
uses: actions/checkout@v3
Expand Down

0 comments on commit 75bd362

Please sign in to comment.