Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(wip): add a test-ecosystem-snapshot job to run the failed suite … #11

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/ecosystem-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jobs:
- vueuse
- vue-simple-compiler
fail-fast: false
outputs:
suite: ${{ matrix.suite }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down Expand Up @@ -86,3 +88,34 @@ jobs:
STATUS: ${{ job.status }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# TODO:
# move this job into a standalone workflow
# so that it can be triggered by other workflows via workflow_dispatch
test-ecosystem-snapshot:
needs: test-ecosystem
if: failure()
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- run: echo ${{ needs.test-ecosystem.outputs.suite }}
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.ECOSYSTEM_CI_ACCESS_TOKEN }}
script: |
// first, list workflow runs for ecosystem-ci.yml
const { data: { workflow_runs } } = await github.rest.actions.listWorkflowRuns({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'ecosystem-ci.yml',
event: 'schedule',
status: 'completed'
});

// the default number of results per page is 30,
// that covers the last 10 weeks of runs, which should be enough

// TODO:
// check for previous scheduled `test-ecosystem` job runs and find the last successful one
// use that timestamp to get the snapshot of the corresponding repository
// then run again the failed suite with the snapshot