-
Notifications
You must be signed in to change notification settings - Fork 27
79 lines (67 loc) · 2.18 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Tests
on: [push, pull_request]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install luacheck
run: |
sudo apt-get update
sudo apt-get install luarocks
sudo luarocks install luacheck
- uses: pre-commit/action@v3.0.0
lean3-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.lean_version }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- id: get-version
name: Get the Lean 3 version used by fixtures
shell: python
run: |
from pathlib import Path
import os
import json
import tomllib
leanpkg, = Path(".").rglob("leanpkg.toml")
metadata = tomllib.loads(leanpkg.read_text())["package"]
with open(os.environ["GITHUB_OUTPUT"], "a") as out:
out.write(f"lean_version={json.dumps([metadata['lean_version']])}")
ci:
needs: lean3-version
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
nvim-version:
- stable
- nightly
lean-version: ${{ fromJson(needs.lean3-version.outputs.version) }}
steps:
- uses: actions/checkout@v4
- name: Give leanpkg (fake) greadlink on macOS
run: cp scripts/fake_greadlink /usr/local/bin/greadlink
if: runner.os == 'macOS'
- name: Install elan
run: |
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- --default-toolchain "${{ matrix.lean-version }}" -y
echo "$HOME/.elan/bin/" >> $GITHUB_PATH
- name: Install Neovim
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: ${{ matrix.nvim-version }}
- name: Install the Lean LSP
run: sudo npm install -g lean-language-server
if: contains(matrix.lean-version, 'lean:3')
- name: Run tests
run: make TEST_SEQUENTIAL=1 test