Skip to content

Build

Build #756

Workflow file for this run

name: Build
on:
push:
tags:
- "1.*"
- "2.*"
- "3.*"
- "4.*"
pull_request:
workflow_dispatch:
jobs:
build-electron:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
architecture: [x64]
electron: [32.0.0, 24.0.0]
python_version: ["3.10"]
electron_mocha_version: ["^13"]
include:
- architecture: x64
architecture_node: x64
target_architecture: x64
- electron: 32.0.0
node: 20.16.0
- electron: 24.0.0
node: 18.14.0
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
architecture: ${{ matrix.architecture_node }}
- run: node --version
- run: npm --version
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-electron-${{ matrix.target_architecture }}-${{ matrix.architecture }}-${{ matrix.electron }}-${{ hashFiles('**/package-lock.json') }}
- uses: Wandalen/wretry.action@v3
with:
command: npm install -g electron@${{ matrix.electron }} electron-mocha@${{ matrix.electron_mocha_version }}
attempt_limit: 3
attempt_delay: 10000
- name: Run test
uses: GabrielBB/xvfb-action@v1
with:
run: npm run test:electron
if: ${{ matrix.target_architecture != 'arm64' }}
- run: ./node_modules/.bin/node-pre-gyp package testpackage
env:
npm_config_runtime: electron
npm_config_target: ${{ matrix.electron }}
if: ${{ matrix.target_architecture != 'arm64' }}
- run: ./node_modules/.bin/node-pre-gyp package --target_arch=${{ matrix.target_architecture }}
if: ${{ matrix.target_architecture == 'arm64' }}
env:
npm_config_runtime: electron
npm_config_target: ${{ matrix.electron }}
- uses: actions/upload-artifact@v4
with:
path: build/stage/julianhille/MuhammaraJS/releases/download/**/*.gz
name: bindings-electron-${{ matrix.os }}-${{ matrix.target_architecture }}-${{matrix.electron}}
if-no-files-found: error