chore: use self-hosted actions runner for some runs (#13543)
This commit is contained in:
parent
ba502f7027
commit
666e8302c7
1 changed files with 44 additions and 26 deletions
70
.github/workflows/ci.yml
vendored
70
.github/workflows/ci.yml
vendored
|
|
@ -2,31 +2,29 @@ name: CI
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- "master"
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- "*"
|
||||||
pull_request:
|
pull_request:
|
||||||
merge_group:
|
merge_group:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 7 * * *' # 8AM CET/11PM PT
|
- cron: "0 7 * * *" # 8AM CET/11PM PT
|
||||||
# for manual re-release of a nightly
|
# for manual re-release of a nightly
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
action:
|
action:
|
||||||
description: 'Action'
|
description: "Action"
|
||||||
required: true
|
required: true
|
||||||
default: 'release nightly'
|
default: "release nightly"
|
||||||
type: choice
|
type: choice
|
||||||
options:
|
options:
|
||||||
- release nightly
|
- release nightly
|
||||||
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
# This job determines various settings for the following CI runs; see the `outputs` for details
|
# This job determines various settings for the following CI runs; see the `outputs` for details
|
||||||
configure:
|
configure:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -221,6 +219,16 @@ jobs:
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Check self-hosted runner availability
|
||||||
|
id: runner-fallback
|
||||||
|
uses: mikehardy/runner-fallback-action@v1
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.READ_RUNNERS_TOKEN }}
|
||||||
|
primary-runner: self-hosted,chonk
|
||||||
|
fallback-runner: nscloud-ubuntu-24.04-amd64-8x16
|
||||||
|
organization: leanprover
|
||||||
|
primaries-required: 1
|
||||||
|
|
||||||
- name: Configure build matrix
|
- name: Configure build matrix
|
||||||
id: set-matrix
|
id: set-matrix
|
||||||
uses: actions/github-script@v8
|
uses: actions/github-script@v8
|
||||||
|
|
@ -234,6 +242,17 @@ jobs:
|
||||||
let large = ${{ github.repository == 'leanprover/lean4' }};
|
let large = ${{ github.repository == 'leanprover/lean4' }};
|
||||||
const isPr = "${{ github.event_name }}" == "pull_request";
|
const isPr = "${{ github.event_name }}" == "pull_request";
|
||||||
const isPushToMaster = "${{ github.event_name }}" == "push" && "${{ github.ref_name }}" == "master";
|
const isPushToMaster = "${{ github.event_name }}" == "push" && "${{ github.ref_name }}" == "master";
|
||||||
|
|
||||||
|
// Only users with write access may use the chonk runners.
|
||||||
|
const permission = await github.rest.repos.getCollaboratorPermissionLevel({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
username: context.actor,
|
||||||
|
});
|
||||||
|
const trusted = ["admin", "write"].includes(permission.data.permission);
|
||||||
|
const chonk = trusted ? ${{ steps.runner-fallback.outputs.use-runner }} : "nscloud-ubuntu-24.04-amd64-8x16";
|
||||||
|
console.log(`trusted: ${trusted}, chonk: ${chonk}`);
|
||||||
|
|
||||||
let matrix = [
|
let matrix = [
|
||||||
/* TODO: to be updated to new LLVM
|
/* TODO: to be updated to new LLVM
|
||||||
{
|
{
|
||||||
|
|
@ -255,7 +274,7 @@ jobs:
|
||||||
// portable release build: use channel with older glibc (2.26)
|
// portable release build: use channel with older glibc (2.26)
|
||||||
"name": "Linux release",
|
"name": "Linux release",
|
||||||
// usually not a bottleneck so make exclusive to `fast-ci`
|
// usually not a bottleneck so make exclusive to `fast-ci`
|
||||||
"os": large && fast ? "nscloud-ubuntu-24.04-amd64-8x16" : "ubuntu-latest",
|
"os": large && fast ? chonk : "ubuntu-latest",
|
||||||
"release": true,
|
"release": true,
|
||||||
// Special handling for release jobs. We want:
|
// Special handling for release jobs. We want:
|
||||||
// 1. To run it in PRs so developers get PR toolchains (so secondary without tests is sufficient)
|
// 1. To run it in PRs so developers get PR toolchains (so secondary without tests is sufficient)
|
||||||
|
|
@ -276,7 +295,7 @@ jobs:
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Linux Lake",
|
"name": "Linux Lake",
|
||||||
"os": large ? "nscloud-ubuntu-24.04-amd64-8x16" : "ubuntu-latest",
|
"os": large ? chonk : "ubuntu-latest",
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"check-rebootstrap": level >= 1,
|
"check-rebootstrap": level >= 1,
|
||||||
// Done as part of test-bench
|
// Done as part of test-bench
|
||||||
|
|
@ -466,24 +485,23 @@ jobs:
|
||||||
# mark as merely cancelled not failed if builds are cancelled
|
# mark as merely cancelled not failed if builds are cancelled
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
steps:
|
steps:
|
||||||
- if: ${{ contains(needs.*.result, 'failure') && github.repository == 'leanprover/lean4' && github.ref_name == 'master' }}
|
- if: ${{ contains(needs.*.result, 'failure') && github.repository == 'leanprover/lean4' && github.ref_name == 'master' }}
|
||||||
uses: zulip/github-actions-zulip/send-message@v1
|
uses: zulip/github-actions-zulip/send-message@v1
|
||||||
with:
|
with:
|
||||||
api-key: ${{ secrets.ZULIP_BOT_KEY }}
|
api-key: ${{ secrets.ZULIP_BOT_KEY }}
|
||||||
email: "github-actions-bot@lean-fro.zulipchat.com"
|
email: "github-actions-bot@lean-fro.zulipchat.com"
|
||||||
organization-url: "https://lean-fro.zulipchat.com"
|
organization-url: "https://lean-fro.zulipchat.com"
|
||||||
to: "infrastructure"
|
to: "infrastructure"
|
||||||
topic: "Github actions"
|
topic: "Github actions"
|
||||||
type: "stream"
|
type: "stream"
|
||||||
content: |
|
content: |
|
||||||
A build of `${{ github.ref_name }}`, triggered by event `${{ github.event_name }}`, [failed](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).
|
A build of `${{ github.ref_name }}`, triggered by event `${{ github.event_name }}`, [failed](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).
|
||||||
- if: contains(needs.*.result, 'failure')
|
- if: contains(needs.*.result, 'failure')
|
||||||
uses: actions/github-script@v8
|
uses: actions/github-script@v8
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
core.setFailed('Some jobs failed')
|
core.setFailed('Some jobs failed')
|
||||||
|
|
||||||
|
|
||||||
# This job creates releases from tags
|
# This job creates releases from tags
|
||||||
# (whether they are "unofficial" releases for experiments, or official releases when the tag is "v" followed by a semver string.)
|
# (whether they are "unofficial" releases for experiments, or official releases when the tag is "v" followed by a semver string.)
|
||||||
release:
|
release:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue