Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
69 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Build | ||
on: [push, pull_request] | ||
env: | ||
# GitHub actions does not define this but should | ||
CI: 'true' | ||
jobs: | ||
combinations: | ||
# git push --tags does not create any commits so should not trigger a new | ||
# workflow. There are no ways to skip workflows, so we skip jobs instead | ||
if: toJson(github.event.commits) != '[]' | ||
strategy: | ||
# Test on Windows/Mac/Linux using latest Node.js. | ||
# Also test on Linux with older Node.js versions. | ||
# We do not run each possible combination to make CI faster. | ||
matrix: | ||
os: [ubuntu-latest, macOS-latest, windows-latest] | ||
node: [10.17.0, 13] | ||
exclude: | ||
- os: macOS-latest | ||
node: 10.17.0 | ||
- os: windows-latest | ||
node: 10.17.0 | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
# We do not use @actions/cache because restoring/saving cache currently | ||
# takes more time than the time saved on `npm ci` | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v1 | ||
- name: Node.js ${{ matrix.node }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Linting | ||
run: npx gulp check | ||
- name: Build | ||
run: npx gulp build | ||
- name: Tests | ||
run: npx gulp unit | ||
- name: Upload test coverage | ||
run: npx gulp uploadCoverage | ||
# Performed after each OS + Node.js version combination has succeeded | ||
final: | ||
needs: combinations | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v1 | ||
- name: Node.js 13 | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 13 | ||
- name: Install dependencies | ||
run: npm ci | ||
# Test coverage check must happen after tests for the whole matrix have been | ||
# performed, so we get the merged coverage map | ||
- name: Check test coverage | ||
run: npx gulp checkCoverage | ||
- name: Build | ||
run: npx gulp build | ||
- name: Deploy | ||
if: | ||
startsWith(github.event.head_commit.message, 'Release ') && | ||
github.event_name != 'pull_request' | ||
run: npx gulp publish | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file was deleted.
Oops, something went wrong.