ci: install python dependencies #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Test | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build-and-test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 20 | |
- name: Setup Python and Install distutils (if needed) | |
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install Python dependencies for node-gyp on Ubuntu/MacOS | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y python3-distutils python3-setuptools | |
- name: Install Python dependencies for node-gyp on macOS | |
if: ${{ matrix.os == 'macos-latest' }} | |
run: | | |
brew install [email protected] | |
echo "Setting Python version for node-gyp" | |
npm config set python $(which python3) | |
- name: Install Python dependencies for node-gyp on Windows | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
npm config set python $(where python) | |
- run: npm install | |
- run: npm test |