Skip to content

Commit bb5c304

Browse files
committed
Add CI for testing the built wheels
1 parent 55d2aba commit bb5c304

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

.github/workflows/test.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Test
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request: {}
7+
8+
concurrency:
9+
group: ${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
build-wheels:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-python@v4
18+
with:
19+
python-version: "3.10"
20+
cache: 'pip'
21+
- name: Install dependencies
22+
run: |
23+
pip install -r requirements.txt
24+
- name: Build Wheels
25+
run: |
26+
python make_wheels.py
27+
- name: Show built files
28+
run: |
29+
ls -l dist/*
30+
- uses: actions/upload-artifact@v3
31+
with:
32+
name: nodejs-pip-wheels-${{ github.ref }}
33+
path: dist/
34+
if-no-files-found: error
35+
retention-days: 1
36+
37+
test:
38+
name: "Test ${{ matrix.os }} Python:${{ matrix.python-version }} NodeJS:${{ matrix.nodejs-version }}"
39+
runs-on: ${{ matrix.os }}
40+
needs: [build-wheels]
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
os: [ubuntu-latest, windows-latest, macos-latest]
45+
nodejs-version: ['16.15.1', '14.19.3', '18.4.0']
46+
python-version: ['3.7', '3.8', '3.9', '3.10']
47+
48+
steps:
49+
- uses: actions/checkout@v3
50+
- name: Set up Python ${{ matrix.python-version }}
51+
uses: actions/setup-python@v4
52+
with:
53+
python-version: ${{ matrix.python-version }}
54+
- uses: actions/download-artifact@v3
55+
with:
56+
name: nodejs-pip-wheels-${{ github.ref }}
57+
path: dist
58+
- name: Show available wheels
59+
run: |
60+
ls dist
61+
- name: Install Package (Linux)
62+
if: matrix.os == 'ubuntu-latest'
63+
run: |
64+
WHEELS_TO_INSTALL=$(find dist -name "*${{matrix.nodejs-version}}*py3*manylinux*x86_64.whl")
65+
echo "WHEELS_TO_INSTALL=${WHEELS_TO_INSTALL}"
66+
pip install ${WHEELS_TO_INSTALL}
67+
- name: Install Package (Mac OS)
68+
if: matrix.os == 'macos-latest'
69+
run: |
70+
WHEELS_TO_INSTALL=$(find dist -name "*${{matrix.nodejs-version}}*py3*macosx*x86_64.whl")
71+
echo "WHEELS_TO_INSTALL=${WHEELS_TO_INSTALL}"
72+
pip install ${WHEELS_TO_INSTALL}
73+
- name: Install Package (Windows)
74+
if: matrix.os == 'windows-latest'
75+
run: |
76+
pip install dist\nodejs_bin-${{matrix.nodejs-version}}a3-py3-none-win_amd64.whl
77+
- name: Test Package
78+
run:
79+
python -m nodejs --version
80+
python -m nodejs.npm --version
81+
82+

0 commit comments

Comments
 (0)