-
Notifications
You must be signed in to change notification settings - Fork 438
66 lines (53 loc) · 1.93 KB
/
python-package.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
name: Python package
on:
# Always build installable package, except for docs changes
push:
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
# Use only lowest and highest supported python versions for now,
# to speed up CI runs
python-version: [3.8, "3.12"]
node-version: [16]
fail-fast: false
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
# Dependencies are in setup.py, so use it as cache key
cache-dependency-path: 'setup.py'
- name: Set up NodeJS ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: package.json
- name: Install Javascript dependencies using npm
run: make init
- name: Create Javascript artifacts (but skip manpages)
run: make js
- name: Generate Isso package
id: generate-package
run: |
pip install setuptools
python setup.py sdist
echo "::set-output name=package_file::$(ls dist/)"
- name: Install generated Isso package
run: pip install dist/${{ steps.generate-package.outputs.package_file }}
- name: Archive and upload generated package
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-python-${{ matrix.python-version }}-${{ steps.generate-package.outputs.package_file }}
path: dist/${{ steps.generate-package.outputs.package_file }}
- name: Clean up Isso package from site-packages
# This ensures it isn't accidentally restored by the "setup-python"
# action
run: pip uninstall --y isso