Merge pull request #96 from pbredenberg/pb/ci-migrate-to-github-actions

ci: migrate to GitHub actions
This commit is contained in:
Ethan Smith 2023-04-21 11:41:40 -04:00 committed by GitHub
commit 4ceb44ff0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 19 deletions

38
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,38 @@
name: CI
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history
-
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- run: npm i -g npm@8.5.5
- run: npm ci
- run: npm run standards
test:
needs: [ build ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [ 14, 16, 'lts/*', 'latest' ]
steps:
- uses: actions/checkout@v3
-
name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm i -g npm@8.5.5
- run: npm ci # Reinstall the dependencies to ensure they install with the current version of node
- run: npm test
- name: Coveralls
uses: coverallsapp/github-action@v1

View file

@ -1,18 +0,0 @@
dist: focal
language: node_js
node_js:
- "node" # Latest node version
- "lts/*" # Latest LTS version
- "16"
- "14"
before_install: npm i -g npm@8.5.5
script:
- npm run commitlint
- npm run standards
- npm test
# For code coverage:
after_success:
cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage

View file

@ -10,7 +10,7 @@
"markdownlint": "markdownlint -c .markdownlint.json -i CHANGELOG.md '{,!(node_modules)/**/}*.md'",
"eslint": "eslint '{,!(node_modules|dist)/**/}*.js'",
"stylelint": "stylelint './src/scss/**/*.scss'",
"standards": "npm run markdownlint && npm run stylelint && npm run eslint",
"standards": "npm run commitlint && npm run markdownlint && npm run stylelint && npm run eslint",
"release:preview": "node ./node_modules/@silvermine/standardization/scripts/release.js preview",
"release:prep-changelog": "node ./node_modules/@silvermine/standardization/scripts/release.js prep-changelog",
"release:finalize": "node ./node_modules/@silvermine/standardization/scripts/release.js finalize"