-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (77 loc) · 2.67 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
80
81
82
83
84
85
86
87
name: CI
on:
push:
branches: ["**"] # For now, let's build all branches. Roll this back if it gets too slow or we exhaust our quota.
pull_request:
branches: ["**"] # * does not match '/'
workflow_dispatch: # For manually triggering a build: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#workflow_dispatch
jobs:
build:
strategy:
matrix:
# We mainly care about hardware rather than OS
# macos-13 is x86
# macos-latest is arm64
# ubuntu-latest is x64
os: [ubuntu-latest, macos-latest, macos-13]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
# Build (and test) Lean. Tests are all via #guard macros
# now so you can't really build without testing.
- uses: leanprover/lean-action@v1
- name: Run tests
run: lake exe klr
# Run pytest
- uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
- name: Install dependencies
working-directory: ./interop
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run pytest
working-directory: ./interop
run: |
pytest
- name: Make a wheel
# https://github.com/pypa/cibuildwheel
# Hit this: https://github.com/pypa/cibuildwheel/discussions/1926
env:
# https://github.com/leanprover/lean4/pull/6631/files
MACOSX_DEPLOYMENT_TARGET: 99.0
CIBW_BUILD_VERBOSITY: 1
CIBW_SKIP: 'pp* *-win32 *-manylinux_i686 *-musllinux_*' # The build doesn't work 686 or musl
run: |
pip install cibuildwheel
bin/make-wheel
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./.wheel/wheelhouse/*.whl
if-no-files-found: error
publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: testpypi
# url: https://test.pypi.org/p/klr
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
# name: python-package-distributions
# # unpacks all CIBW artifacts into dist/
# pattern: cibw-*
path: dist/
merge-multiple: true
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/