Install OS packages before node/pnpm and package install #5
This file contains hidden or 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: Test | |
| on: | |
| push: | |
| branches-ignore: | |
| - master | |
| tags-ignore: | |
| - "**" | |
| pull_request: | |
| permissions: | |
| contents: read | |
| env: | |
| SECRETS: ${{ toJSON(secrets) }} | |
| ELECTRON_VERSION: 41.0.0 | |
| jobs: | |
| linux: | |
| name: ${{ matrix.name }} | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: build-24 | |
| run_tests: true | |
| run_electron_tests: false | |
| - name: build-electron-41 | |
| run_tests: false | |
| run_electron_tests: true | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v6 | |
| with: | |
| lfs: true | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Install Linux dependencies | |
| run: sudo apt-get update && sudo apt-get install -y libgtk2.0-0 libgtk-3-dev libxtst6 libxss1 libnss3 libasound2 xvfb libssl-dev pkg-config | |
| - name: Setup Project | |
| uses: ./.github/actions/setup-node-pnpm | |
| - name: Build | |
| run: | | |
| GYP_ARGS=( | |
| --runtime=electron | |
| --target="${ELECTRON_VERSION}" | |
| --dist-url=https://electronjs.org/headers | |
| ) | |
| pnpm exec node-pre-gyp rebuild package testpackage "${GYP_ARGS[@]}" | |
| - name: Run Tests | |
| if: matrix.run_tests | |
| run: pnpm test | |
| - name: Run Electron Tests | |
| if: matrix.run_electron_tests | |
| run: | | |
| pnpm run pretest | |
| xvfb-run pnpm exec electron-mocha --timeout 480000 | |
| macos: | |
| name: ${{ matrix.name }} | |
| runs-on: macos-13 | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: build-macos-24 | |
| target_arch: "" | |
| run_tests: true | |
| - name: build-macos-24-arm64 | |
| target_arch: arm64 | |
| run_tests: false | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v6 | |
| with: | |
| lfs: true | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Setup Project | |
| uses: ./.github/actions/setup-node-pnpm | |
| - name: Build | |
| env: | |
| TARGET_ARCH: ${{ matrix.target_arch }} | |
| run: | | |
| GYP_ARGS=( | |
| --runtime=electron | |
| --target="${ELECTRON_VERSION}" | |
| --dist-url=https://electronjs.org/headers | |
| ) | |
| if [[ -n "${TARGET_ARCH:-}" ]]; then | |
| GYP_ARGS+=(--target_arch="${TARGET_ARCH}") | |
| fi | |
| pnpm exec node-pre-gyp rebuild package testpackage "${GYP_ARGS[@]}" | |
| - name: Run Tests | |
| if: matrix.run_tests | |
| run: pnpm test | |
| windows: | |
| name: ${{ matrix.name }} | |
| runs-on: windows-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: windows-24_x86 | |
| node_arch: x86 | |
| target_arch: "" | |
| run_tests: true | |
| - name: windows-24_x64 | |
| node_arch: x64 | |
| target_arch: "" | |
| run_tests: true | |
| - name: windows-24_arm64 | |
| node_arch: x64 | |
| target_arch: arm64 | |
| run_tests: false | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v6 | |
| with: | |
| lfs: true | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Setup Project | |
| uses: ./.github/actions/setup-node-pnpm | |
| with: | |
| node-architecture: ${{ matrix.node_arch }} | |
| - name: Build | |
| env: | |
| TARGET_ARCH: ${{ matrix.target_arch }} | |
| run: | | |
| GYP_ARGS=( | |
| --runtime=electron | |
| --target="${ELECTRON_VERSION}" | |
| --dist-url=https://electronjs.org/headers | |
| ) | |
| if [[ -n "${TARGET_ARCH:-}" ]]; then | |
| GYP_ARGS+=(--target_arch="${TARGET_ARCH}") | |
| fi | |
| pnpm exec node-pre-gyp rebuild package testpackage "${GYP_ARGS[@]}" | |
| - name: Run Tests | |
| if: matrix.run_tests | |
| run: | | |
| pnpm test | |
| pnpm exec electron-mocha --timeout 480000 |