Skip to content

Commit

Permalink
Create build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
pitmonticone authored and PatrickMassot committed Feb 19, 2025
1 parent 69e817b commit e125035
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch: # Allow manual triggering of the workflow from the GitHub Actions interface

# Cancel previous runs if a new commit is pushed to the same PR or branch
concurrency:
group: ${{ github.ref }} # Group runs by the ref (branch or PR)
cancel-in-progress: true # Cancel any ongoing runs in the same group

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages and modify PR labels
permissions:
contents: read # Read access to repository contents
pages: write # Write access to GitHub Pages
id-token: write # Write access to ID tokens

jobs:
build_project:
runs-on: ubuntu-latest
name: Build project
steps:
- name: Checkout project
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags

- name: Install elan
run: curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y

- name: Get Mathlib cache
run: ~/.elan/bin/lake exe cache get || true

- name: Cache build artifacts
uses: actions/cache@v4
with:
path: |
.lake/build
key: LakeBuild-${{ runner.os }}-${{ hashFiles('lean-toolchain') }}-${{ hashFiles('lake-manifest.json') }}

- name: Build project
run: ~/.elan/bin/lake build Project

0 comments on commit e125035

Please sign in to comment.