Skip to content

chore: update action to use node 20 #42

chore: update action to use node 20

chore: update action to use node 20 #42

Workflow file for this run

name: pull-request
on:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: yarn install
- name: Lint
run: yarn lint
- name: Unit test
run: yarn test
- name: Rebuild the dist/ directory
run: yarn build
- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol ./dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build within the ./dist directory"
exit 1
fi
integration-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Get version
id: version
uses: ./
- name: Check version outputs
uses: actions/github-script@v6
with:
script: |
const assert = require('assert')
const outputs = ${{ toJSON(steps.version.outputs) }}
// check default / no-input outputs
const [ major, minor, patch ] = outputs.version.split('.')
assert.deepEqual(outputs['version-with-prefix'], `v${major}.${minor}.${patch}`)
assert.deepEqual(outputs.major, major)
assert.deepEqual(outputs['major-with-prefix'], `v${major}`)
assert.deepEqual(outputs.minor, minor)
assert.deepEqual(outputs.patch, patch)
// check output is a valid bump string
assert.deepEqual(['major','minor','patch'].indexOf(outputs.bump) > -1, true)