-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
84 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,97 @@ | ||
name: CI | ||
|
||
# https://github.com/FormalizedFormalLogic/Foundation/blob/master/.github/workflows/ci.yml | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- "master" | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# concurrency: | ||
# group: ${{ github.workflow }}-${{ github.ref }} | ||
# cancel-in-progress: true | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Build project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Install elan | ||
run: | | ||
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain none | ||
echo "$HOME/.elan/bin" >> $GITHUB_PATH | ||
- name: Cache outputs | ||
uses: actions/cache@v3 | ||
- name: Check toolchain version | ||
run: | | ||
elan --version | ||
lake --version | ||
lean --version | ||
- uses: actions/cache@v4 | ||
with: | ||
path: ./.lake | ||
key: deps-${{ runner.os }}-${{ hashFiles('lean-toolchain') }}-${{ hashFiles('lake-manifest.json') }}-${{ github.sha }} | ||
restore-keys: | | ||
deps-${{ runner.os }}-${{ hashFiles('lean-toolchain') }}-${{ hashFiles('lake-manifest.json') }} | ||
deps-${{ runner.os }}-${{ hashFiles('lean-toolchain') }} | ||
- name: Build | ||
path: .lake | ||
key: lake-${{ runner.os }}-${{ hashFiles('lean-toolchain') }} | ||
restore-keys: lake-${{ runner.os }}-${{ hashFiles('lean-toolchain') }} | ||
|
||
- name: Fetching cache | ||
run: lake -R -Kenv=ci exe cache get | ||
|
||
- name: Build project | ||
run: lake -R -Kenv=ci build | ||
|
||
- uses: ts-graphviz/setup-graphviz@v2 | ||
- name: Generate import graph | ||
run: | | ||
lake exe cache get | ||
lake build | ||
lake -R -Kenv=ci exe graph | ||
dot -Tpng ./import_graph.dot -o import_graph.png | ||
dot -Tpdf ./import_graph.dot -o import_graph.pdf | ||
- name: Upload import graph | ||
uses: actions/upload-artifact@v4 | ||
if: github.ref == 'refs/heads/master' | ||
with: | ||
name: import_graph | ||
path: | | ||
./import_graph.dot | ||
./import_graph.png | ||
./import_graph.pdf | ||
# reference: https://github.com/iehality/lean4-logic/blob/master/.github/workflows/ci.yml | ||
# Generate document only master branch | ||
- name: Generate document | ||
if: github.ref == 'refs/heads/master' | ||
run: lake -R -Kenv=ci build Logic:docs Arithmetization:docs | ||
- name: Upload document | ||
uses: actions/upload-artifact@v4 | ||
if: github.ref == 'refs/heads/master' | ||
with: | ||
name: docs | ||
path: ./.lake/build/doc | ||
|
||
deploy: | ||
name: Deploy to GitHub Pages | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/master' | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
needs: | ||
- build | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: docs | ||
path: ./_site/docs/ | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: import_graph | ||
path: ./_site/assets/import_graph/ | ||
- uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ./_site | ||
- uses: actions/deploy-pages@v4 | ||
id: deployment |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters