From 1d509cf15a447568cf39782afbd1d1c3eb0f9f13 Mon Sep 17 00:00:00 2001 From: Paul Bredenberg Date: Thu, 20 Apr 2023 08:58:03 -0400 Subject: [PATCH 1/2] ci: add GitHub Actions configuration --- .github/workflows/ci.yml | 38 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 18 ------------------ 2 files changed, 38 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b01c62f --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index fc5dfc0..0000000 --- a/.travis.yml +++ /dev/null @@ -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 From 889088fb3704ecf48be6a77a6b14357aa015428c Mon Sep 17 00:00:00 2001 From: Paul Bredenberg Date: Thu, 20 Apr 2023 08:59:13 -0400 Subject: [PATCH 2/2] chore: add commitlint NPM script to standards NPM script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cefe79a..a63053e 100644 --- a/package.json +++ b/package.json @@ -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"