Skip to content

Merge master to nightly #38

Merge master to nightly

Merge master to nightly #38

# This job merges every commit to `master` into `nightly-testing`, resolving merge conflicts in favor of `nightly-testing`.
name: Merge master to nightly
on:
schedule:
- cron: '30 0 * * *' # At 00:30 UTC every day.
workflow_dispatch:
jobs:
merge-to-nightly:
runs-on: ubuntu-latest
if: github.repository == 'leanprover-community/mathlib4'
permissions:
id-token: write
steps:
- name: Generate app token
id: app-token
uses: leanprover-community/mathlib-ci/.github/actions/azure-create-github-app-token@3bb576208589a435eeaeac9b144a1b7c3e948760
with:
app-id: ${{ secrets.MATHLIB_NIGHTLY_TESTING_APP_ID }}
key-vault-name: ${{ vars.MATHLIB_AZ_KEY_VAULT_NAME }}
key-name: mathlib-nightly-testing-app-pk
azure-client-id: ${{ vars.GH_APP_AZURE_CLIENT_ID_NIGHTLY_TESTING }}
azure-tenant-id: ${{ secrets.LPC_AZ_TENANT_ID }}
repositories: mathlib4,mathlib4-nightly-testing
# This token is masked by the token minting action and will not be logged accidentally.
- name: Checkout nightly-testing from fork
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: leanprover-community/mathlib4-nightly-testing
ref: nightly-testing
path: nightly-testing
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0
- name: Configure Lean
uses: leanprover/lean-action@c544e89643240c6b398f14a431bcdc6309e36b3e # v1.4.0
with:
auto-config: false
use-github-cache: false
use-mathlib-cache: false
lake-package-directory: "nightly-testing" # We will run `lake update` here later.
- name: Configure Git User
run: |
cd nightly-testing
git config user.name "mathlib-nightly-testing[bot]"
git config user.email "mathlib-nightly-testing[bot]@users.noreply.github.com"
- name: Merge master to nightly favoring nightly changes
run: |
cd nightly-testing
git remote add upstream https://github.com/leanprover-community/mathlib4.git
git fetch upstream master
# Merge master into nightly-testing, resolving conflicts in favor of nightly-testing
# If the merge goes badly, we proceed anyway via '|| true'.
# CI will report failures on the 'nightly-testing' branch direct to Zulip.
git merge upstream/master --strategy-option ours --no-commit --allow-unrelated-histories || true
# We aggressively run `lake update`, to avoid having to do this by hand.
# When Batteries changes break Mathlib, this will likely show up on nightly-testing first.
lake update -v
git add .
# If there's nothing to do (because there are no new commits from master),
# that's okay, hence the '|| true'.
git commit -m "Merge master into nightly-testing" || true
# Push to the mathlib4-nightly-testing fork
git push origin nightly-testing