Skip to content

ci: run devDependencies only node-lts #387

ci: run devDependencies only node-lts

ci: run devDependencies only node-lts #387

Workflow file for this run

name: build
on:
push:
branches:
- main
- develop
pull_request:
jobs:
check_commit:
runs-on: ubuntu-latest
outputs:
skip_ci: ${{ steps.check_commit.outputs.skip_ci }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Check for devDependencies bump pull request
run: |
echo $(git log --format=%B -n 1 ${{ github.event.pull_request.head.sha }}) | grep -q -F "chore(deps-dev):"
if [ $? -eq 0 ] && [ ${{ matrix.node }} -eq 20 ]; then
echo "skip_ci=true" >> $GITHUB_OUTPUT
else
echo "skip_ci=false" >> $GITHUB_OUTPUT
fi
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['16', '18', '20']
needs: check_commit
if: ${{ needs.check_commit.outputs.skip_ci != 'true' }}
steps:
- uses: actions/checkout@v4
- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install
run: yarn install
- name: Build and test
run: yarn node-gyp rebuild && yarn jest
build-win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup node lts
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install
run: yarn install
- name: Build and test
run: yarn node-gyp rebuild && yarn jest
build-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup node lts
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install
run: yarn install
- name: Build and test
run: yarn node-gyp rebuild && yarn jest