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

chore(ci): remove unneeded Lean version restrictions #2065

Merged
merged 5 commits into from
Feb 28, 2020
Merged
Show file tree
Hide file tree
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
16 changes: 5 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,16 @@ jobs:
build:
name: Build mathlib
runs-on: ubuntu-latest
strategy:
matrix:
lean_version:
- leanprover-community/lean:3.5.1
fail-fast: false
steps:
- uses: actions/checkout@v2

- name: install elan
run: |
set -o pipefail
curl https://raw.githubusercontent.com/Kha/elan/master/elan-init.sh -sSf | sh -s -- --default-toolchain none -y
~/.elan/bin/elan override set ${{ matrix.lean_version }}
~/.elan/bin/lean --version
echo "::add-path::$HOME/.elan/bin"
echo "::set-env name=short_lean_version::$(~/.elan/bin/lean --run scripts/lean_version.lean)"

- name: install azcopy
run: |
Expand All @@ -43,7 +38,7 @@ jobs:
git config --unset http.https://github.com/.extraheader

- name: push release to azure
if: always() && github.repository == 'leanprover-community/mathlib' && github.event_name == 'push' && matrix.lean_version == 'leanprover-community/lean:3.5.1'
if: always() && github.repository == 'leanprover-community/mathlib' && github.event_name == 'push'
run: |
branch=${GITHUB_REF#refs/heads/}
git fetch --depth=1 origin-bot $branch
Expand All @@ -57,7 +52,7 @@ jobs:
fi

- name: push release to mathlib-nightly
if: github.repository == 'leanprover-community/mathlib' && github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.lean_version == 'leanprover-community/lean:3.5.1'
if: github.repository == 'leanprover-community/mathlib' && github.event_name == 'push' && github.ref == 'refs/heads/master'
run: ./scripts/deploy_nightly.sh
env:
DEPLOY_NIGHTLY_GITHUB_TOKEN: ${{ secrets.DEPLOY_NIGHTLY_GITHUB_TOKEN }}
Expand All @@ -66,7 +61,6 @@ jobs:
id: setup_precompiled
run: |
git_hash="$(git log -1 --pretty=format:%h)"
short_lean_version="$(echo ${{ matrix.lean_version }} | sed 's/.*://')"
echo "::set-output name=artifact_name::precompiled-mathlib-$short_lean_version-$git_hash"
- name: upload precompiled mathlib zip file
uses: actions/upload-artifact@v1
Expand Down Expand Up @@ -96,14 +90,14 @@ jobs:
python-version: 3.8

- name: generate docs
if: github.repository == 'leanprover-community/mathlib' && github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.lean_version == 'leanprover-community/lean:3.5.1'
if: github.repository == 'leanprover-community/mathlib' && github.event_name == 'push' && github.ref == 'refs/heads/master'
run:
./scripts/deploy_docs.sh
env:
DEPLOY_NIGHTLY_GITHUB_TOKEN: ${{ secrets.DEPLOY_NIGHTLY_GITHUB_TOKEN }}

- name: update nolints.txt
if: github.repository == 'leanprover-community/mathlib' && github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.lean_version == 'leanprover-community/lean:3.5.1'
if: github.repository == 'leanprover-community/mathlib' && github.event_name == 'push' && github.ref == 'refs/heads/master'
run:
./scripts/update_nolints.sh
env:
Expand Down
11 changes: 10 additions & 1 deletion scripts/deploy_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@ set -x
git_hash="$(git log -1 --pretty=format:%h)"
git clone https://github.com/leanprover-community/doc-gen.git
cd doc-gen

# the commit hash in leanpkg.toml is used by doc_gen.
sed -i "s/rev = \"\S*\"/rev = \"$git_hash\"/" leanpkg.toml

echo -e "builtin_path\npath ./src\npath ../src" > leanpkg.path
git clone "https://$DEPLOY_NIGHTLY_GITHUB_USER:$DEPLOY_NIGHTLY_GITHUB_TOKEN@github.com/leanprover-community/mathlib_docs.git"
rm -rf mathlib_docs/docs/
elan override set leanprover-community/lean:3.5.1

# Force doc_gen project to match the Lean version used in CI.
# If they are incompatible, something in doc_gen will fail to compile,
# but this is better than trying to recompile all of mathlib.
# short_lean_version is of the form 3.5.1 and set earlier in CI.
elan override set "leanprover-community/lean:$short_lean_version"

python3 -m pip install --upgrade pip
pip3 install markdown2 toml
./gen_docs -w -r "../" -t "mathlib_docs/docs/"
Expand Down
3 changes: 2 additions & 1 deletion scripts/deploy_nightly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ fi

# Try to update the lean-x.y.z branch on mathlib. This could fail if
Copy link
Member

@gebner gebner Feb 28, 2020

Choose a reason for hiding this comment

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

We still cannot get rid of this file, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we should keep it at least until leanproject is official.

# a subsequent commit has already pushed an update.
LEAN_VERSION="lean-3.5.1"
# short_lean_version is of the form 3.5.1, set earlier in CI
LEAN_VERSION="lean-$short_lean_version"

git push mathlib HEAD:refs/heads/$LEAN_VERSION || \
echo "mathlib rejected push to branch $LEAN_VERSION; maybe it already has a later version?" >&2
Expand Down