Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): Reduce the number of jobs, move some of them to once a day (…
…#19001) * chore(ci): Reduce the number of jobs, move some of them to once a day Following builds will be done once a day after this is merged: - all binary engine tests - json protocol with non-minimal supported version If PR contains `ci build all` comment, all of those things will be checked. If not, the job that will test them will run at 9am UTC. Since we now need two jobs on different schedules, we need a way to differentiate them: for that reason, both buildpulse and new nightly jobs are implemented as separate workflows, that call original one passing the reason (daily/buildpulse) as a parameter. * Address review comments * Correctly use inputs * Update .github/workflows/daily-test.yml Co-authored-by: Joël Galeran <Jolg42@users.noreply.github.com> * Rename daily-build to daily-test * Use free runners for daily builds * More review feedback --------- Co-authored-by: Joël Galeran <Jolg42@users.noreply.github.com>
- Loading branch information
Showing
5 changed files
with
136 additions
and
28 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Daily BuildPulse run | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# https://crontab.guru - “At every 30th minute past every hour from 3 through 6.” | ||
- cron: '*/30 3-6 * * *' | ||
|
||
jobs: | ||
run_tests: | ||
uses: ./.github/workflows/test.yml | ||
with: | ||
reason: buildpulse | ||
jobTimeout: 70 | ||
ubuntuRunner: ubuntu-latest |
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,32 @@ | ||
name: Daily Test | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# 4am daily Mon-Fri | ||
- cron: '0 4 * * 1-5' | ||
|
||
jobs: | ||
run_tests: | ||
uses: ./.github/workflows/test.yml | ||
with: | ||
reason: daily-test | ||
jobTimeout: 70 | ||
ubuntuRunner: ubuntu-latest | ||
failure: | ||
needs: | ||
- run_tests | ||
if: ${{ failure() }} | ||
name: Communicate failure | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set current job url in SLACK_FOOTER env var | ||
run: echo "SLACK_FOOTER=<$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID|Click here to go to the job logs>" >> $GITHUB_ENV | ||
|
||
- name: Slack Notification on Failure | ||
uses: rtCamp/action-slack-notify@v2.2.0 | ||
env: | ||
SLACK_TITLE: 'prisma/prisma daily build failed :x:' | ||
SLACK_COLOR: '#FF0000' | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
SLACK_CHANNEL: feed-prisma-daily-build-failures |
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 @@ | ||
#!/usr/bin/env node | ||
'use strict' | ||
const fs = require('fs') | ||
|
||
const [reason, buildComment] = process.argv.slice(2) | ||
console.log({ reason, buildComment }) | ||
|
||
const hasBuildAllComment = buildComment?.length > 0 | ||
|
||
const excludeClient = [] | ||
const excludeDataProxy = [] | ||
|
||
const queryEngine = ['library'] | ||
|
||
if (hasBuildAllComment || reason === 'daily-test') { | ||
queryEngine.push('binary') | ||
} else { | ||
excludeClient.push({ node: 18, engineProtocol: 'json' }) | ||
excludeDataProxy.push({ node: 16, engineProtocol: 'json' }, { node: 18, engineProtocol: 'json' }) | ||
} | ||
|
||
const outputRaw = { queryEngine, excludeClient, excludeDataProxy } | ||
|
||
const outputsStr = Object.entries(outputRaw) | ||
.map(([key, value]) => `${key}=${JSON.stringify(value)}`) | ||
.join('\n') | ||
|
||
console.log(outputsStr) | ||
|
||
fs.appendFileSync(process.env.GITHUB_OUTPUT, outputsStr, 'utf8') |
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