|
| 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 | + mkdir dist |
| 27 | + python make_wheels.py |
| 28 | + - name: Show built files |
| 29 | + run: | |
| 30 | + ls -l dist/* |
| 31 | + - uses: actions/upload-artifact@v3 |
| 32 | + with: |
| 33 | + name: nodejs-pip-wheels |
| 34 | + path: dist/ |
| 35 | + if-no-files-found: error |
| 36 | + retention-days: 1 |
| 37 | + |
| 38 | + test: |
| 39 | + name: "Test ${{ matrix.os }} Python:${{ matrix.python-version }} NodeJS:${{ matrix.nodejs-version }}" |
| 40 | + runs-on: ${{ matrix.os }} |
| 41 | + needs: [build-wheels] |
| 42 | + strategy: |
| 43 | + fail-fast: false |
| 44 | + matrix: |
| 45 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 46 | + nodejs-version: ['16.15.1', '14.19.3', '18.4.0'] |
| 47 | + python-version: ['3.7', '3.8', '3.9', '3.10'] |
| 48 | + |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v3 |
| 51 | + - name: Set up Python ${{ matrix.python-version }} |
| 52 | + uses: actions/setup-python@v4 |
| 53 | + with: |
| 54 | + python-version: ${{ matrix.python-version }} |
| 55 | + - uses: actions/download-artifact@v3 |
| 56 | + with: |
| 57 | + name: nodejs-pip-wheels |
| 58 | + path: dist |
| 59 | + - name: Show available wheels |
| 60 | + run: | |
| 61 | + ls dist |
| 62 | + - name: Install Package (Linux) |
| 63 | + if: matrix.os == 'ubuntu-latest' |
| 64 | + run: | |
| 65 | + WHEELS_TO_INSTALL=$(find dist -name "*${{matrix.nodejs-version}}*py3*manylinux*x86_64.whl") |
| 66 | + echo "WHEELS_TO_INSTALL=${WHEELS_TO_INSTALL}" |
| 67 | + pip install ${WHEELS_TO_INSTALL} |
| 68 | + - name: Install Package (Mac OS) |
| 69 | + if: matrix.os == 'macos-latest' |
| 70 | + run: | |
| 71 | + WHEELS_TO_INSTALL=$(find dist -name "*${{matrix.nodejs-version}}*py3*macosx*x86_64.whl") |
| 72 | + echo "WHEELS_TO_INSTALL=${WHEELS_TO_INSTALL}" |
| 73 | + pip install ${WHEELS_TO_INSTALL} |
| 74 | + - name: Install Package (Windows) |
| 75 | + if: matrix.os == 'windows-latest' |
| 76 | + run: | |
| 77 | + pip install dist\nodejs_bin-${{matrix.nodejs-version}}a3-py3-none-win_amd64.whl |
| 78 | + - name: Test Package |
| 79 | + run: |
| 80 | + python -m nodejs --version |
| 81 | + python -m nodejs.npm --version |
| 82 | + |
| 83 | + |
0 commit comments