Build, package and test #300
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, package and test | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- master | |
schedule: | |
- cron: '0 4 * * *' # Runs every day at 4am: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule | |
jobs: | |
build: | |
name: ${{ matrix.os }}, Node.js v${{ matrix.node }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-2019, ubuntu-latest, macos-11] | |
node: ['16.x'] | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 60 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # To fetch all history for all branches and tags. (Will be required for caching with lerna: https://github.com/markuplint/markuplint/pull/111) | |
- name: Use Node.js ${{ matrix.node }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
registry-url: 'https://registry.npmjs.org' | |
- name: Use Python 3.x | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10.8' | |
- name: Build and package | |
shell: bash | |
run: | | |
yarn --skip-integrity-check --network-timeout 100000 | |
yarn electron package | |
env: | |
NODE_OPTIONS: --max_old_space_size=4096 | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9 | |
- name: Test (Linux) | |
if: matrix.tests != 'skip' && runner.os == 'Linux' | |
uses: GabrielBB/xvfb-action@v1 | |
with: | |
run: yarn electron test | |
- name: Test (Windows) | |
if: matrix.tests != 'skip' && runner.os == 'Windows' | |
shell: bash | |
run: | | |
yarn electron test | |
- name: Test (macOS) | |
if: matrix.tests != 'skip' && runner.os == 'macOS' | |
shell: bash | |
run: | | |
yarn electron test | |
- name: Lint | |
if: matrix.tests != 'skip' | |
shell: bash | |
run: | | |
yarn lint |