Coder Social home page Coder Social logo

ruben-vandevelde / lean-upgrade-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leanprover-contrib/lean-upgrade-action

0.0 0.0 0.0 27 KB

An action to upgrade Lean and mathlib versions to their latest

Shell 2.02% Python 89.21% Dockerfile 8.77%

lean-upgrade-action's Introduction

lean-upgrade-action

This is a GitHub action for Lean projects. At a scheduled time, it will try to update the Lean version and dependencies of your project to their latest versions. If the automatic upgrade fails (e.g. if your project does not build or fails its leanpkg test), it will create an issue in your project repository.

The upgrade logic works like this:

  • If your project depends on mathlib, it will call leanproject upgrade-mathlib. That is,
    • The Lean version will be bumped to the Lean version of mathlib master.
    • The mathlib dependency will be bumped to mathlib master.
    • All other dependencies will be bumped to the same Lean version, if they have a corresponding branch.
  • If your project does not depend on mathlib, but the Lean version is comparable to that of mathlib master, e.g. both are leanprover-community/lean:
    • The Lean version will be bumped to the Lean version of mathlib master.
    • All other dependencies will be bumped to the same Lean version, if they have a corresponding branch.
  • If your project uses a Lean version incomparable to that of mathlib:
    • The Lean version will not change.
    • All other dependencies will be bumped to the latest releases for your current Lean version.

Usage

Create a file in your Lean project directory, /.github/workflows/upgrade_lean.yml, with contents:

on:
  schedule:
    - cron: '0 2 * * *'

jobs:
  upgrade_lean:
    runs-on: ubuntu-latest
    name: Bump Lean and dependency versions
    steps:
      - name: checkout project
        uses: actions/checkout@v2
      - name: upgrade Lean and dependencies
        uses: leanprover-contrib/lean-upgrade-action@master
        with:
          repo: ${{ github.repository }}
          access-token: ${{ secrets.GITHUB_TOKEN }}
      - name: update version branches
        uses: leanprover-contrib/update-versions-action@master

Advanced notes

If you are running this action from a repo other than the one it is updating, or if you have set up branch protection rules on your lean-x.y.z branches, you will have to modify the checkout step to point to the right repo with write permissions. For instance:

    - name: checkout project
      uses: actions/checkout@v2
      with:
        repository: leanprover-community/mathlib
        token: ${{ secrets.PA_TOKEN }}
        fetch-depth: 0

Alternatively, you can specify a remote name for the branch to push to; it defaults to origin.

    - name: update branch
      uses: leanprover-contrib/update-versions-action@master
      with:
        remote: new-origin

This action is often used in combination with the update versions action. Unfortunately, due to limitations in the GitHub Actions API, that action will only be triggered by this one when a token other than secrets.GITHUB_TOKEN is used. If you change the token away from GitHub's default, you should probably remove the update version branches step from the workflow.

If you don't know what any of this means, you can probably ignore it. Just copy the first block of code into your project.

Options

The above workflow will run once per day at 02:00 UTC. Modify the cron expression to reschedule.

lean-upgrade-action's People

Contributors

robertylewis avatar julian avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.