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

make this action mathlib-independent #17

Merged
merged 5 commits into from
Jun 10, 2024
Merged
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: 10 additions & 23 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ inputs:
Default: "silent".
required: true
default: "silent"
token:
token:
description: |
A Github token to be used for committing
required: true
Expand All @@ -28,25 +28,13 @@ outputs:
runs:
using: "composite"
steps:

- name: Check that project has Mathlib as a dependency
id: check-mathlib
run: |
OUTCOME=$(bash ${{ github.action_path }}/check-mathlib.sh)
echo "$OUTCOME" >> "$GITHUB_OUTPUT"
echo "info: $OUTCOME"
shell: bash

- name: Give up if not using mathlib
if: steps.check-mathlib.outputs.uses_mathlib == 'false'
run: |
echo "This action requires the lean project to have mathlib as a dependency."
exit 1
shell: bash

- name: Update lean-toolchain
run: |
curl -L https://raw.githubusercontent.com/leanprover-community/mathlib4/master/lean-toolchain -o lean-toolchain
LATEST_LEAN=$(gh release list --repo leanprover/lean4 --limit 1 | awk '{print $1}')
echo "The latest release/prerelase is: $LATEST_LEAN"
echo "leanprover/lean4:$LATEST_LEAN" > lean-toolchain
env:
GH_TOKEN: ${{ github.token }}
shell: bash

- name: Install elan
Expand All @@ -71,10 +59,9 @@ runs:
if: steps.check-update.outputs.files_changed == 'true'
id: build-lean
continue-on-error: true
run: |
lake exe cache get || true
lake build
shell: bash
uses: leanprover/lean-action@main
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: when new release of lean-action come, this line should be updated.

with:
test: false

- name: Record outcome
id: record-outcome
Expand Down Expand Up @@ -120,7 +107,7 @@ runs:
- name: Commit update if the updated lean build was successful
if: steps.build-lean.outcome == 'success' && inputs.on_update_succeeds == 'commit'
uses: EndBug/[email protected]
with:
with:
default_author: github_actions

- name: Open issue if the updated lean build fails
Expand Down