Skip to content

Commit

Permalink
ci: change to run devDependencies only node-lts
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshoku committed Jan 28, 2024
1 parent 5c77d5e commit 40492c7
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ on:
push:
branches:
- main
- develop
pull_request:
types: [opened, reopened, synchronize]
- dev*

jobs:
build:
Expand Down
80 changes: 80 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: build

on: pull_request

jobs:
check_commit:
runs-on: ubuntu-latest
outputs:
skip_ci: ${{ steps.check_commit.outputs.deps_dev }}
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 ]; then
echo "deps_dev=true" >> $GITHUB_OUTPUT
else
echo "deps_dev=false" >> $GITHUB_OUTPUT
fi
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['16', '18', '20']
needs: check_commit
if: ${{ needs.check_commit.outputs.deps_dev == 'false' }}
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-deps-dev:
runs-on: ubuntu-latest
needs: check_commit
if: ${{ needs.check_commit.outputs.deps_dev == 'true' }}
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-win:
runs-on: windows-latest
needs: check_commit
if: ${{ needs.check_commit.outputs.deps_dev == 'false' }}
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
needs: check_commit
if: ${{ needs.check_commit.outputs.deps_dev == 'false' }}
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

0 comments on commit 40492c7

Please sign in to comment.