Spread (large) #67
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
name: Spread (large) | |
on: | |
pull_request: | |
types: [ labeled ] | |
schedule: | |
- cron: "0 2 * * 0,3" # run at 2 AM on Sundays and Wednesdays | |
jobs: | |
snap-build: | |
if: ${{ github.event.label.name == 'run-large-spread' || github.event_name == 'schedule' }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build snap | |
uses: snapcore/action-build@v1 | |
id: rockcraft | |
- name: Upload snap artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: snap | |
path: ${{ steps.rockcraft.outputs.snap }} | |
snap-tests: | |
if: ${{ github.event.label.name == 'run-large-spread' || github.event_name == 'schedule' }} | |
runs-on: self-hosted | |
needs: [snap-build] | |
steps: | |
- name: Cleanup job workspace | |
run: | | |
rm -rf "${{ github.workspace }}" | |
mkdir "${{ github.workspace }}" | |
- name: Checkout rockcraft | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Download snap artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: snap | |
path: tests | |
- name: Run spread (large) | |
run: spread tests/spread/large/ | |
- name: Discard spread workers | |
if: always() | |
run: | | |
shopt -s nullglob | |
for r in .spread-reuse.*.yaml; do | |
spread -discard -reuse-pid="$(echo "$r" | grep -o -E '[0-9]+')" | |
done |