Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ci): Switch to GitHub Actions CI (#1600)
* Switch to GitHub Actions CI * Add a benchmark npm script * CI: ignore dependabot branches * benchmark.yml: allow skipping benchmark run through commit messages One can use [bench skip] or [skip bench] in the commit message to skip running the benchmark action * site.yml: add caching, CI and FORCE_COLOR env vars * Move Coveralls to Actions
- Loading branch information
Showing
10 changed files
with
167 additions
and
44 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,43 @@ | ||
name: Benchmark | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- 'dependabot/**' | ||
pull_request: | ||
|
||
env: | ||
CI: true | ||
FORCE_COLOR: 2 | ||
NODE: 14 | ||
|
||
jobs: | ||
benchmark: | ||
runs-on: ubuntu-latest | ||
if: "!contains(github.event.commits[0].message, '[bench skip]') || !contains(github.event.commits[0].message, '[skip bench]')" | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '${{ env.NODE }}' | ||
|
||
- name: Set up npm cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.OS }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }} | ||
${{ runner.OS }}-node-v${{ env.NODE }}- | ||
- name: Install npm dependencies | ||
run: npm ci | ||
|
||
- name: Run benchmarks | ||
run: npm run benchmark | ||
env: | ||
BENCHMARK: true |
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,61 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- 'dependabot/**' | ||
pull_request: | ||
|
||
env: | ||
CI: true | ||
FORCE_COLOR: 2 | ||
NODE_COV: 14 # The Node.js version to run coveralls on | ||
|
||
jobs: | ||
run: | ||
name: Node ${{ matrix.node }} | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node: | ||
- 10 | ||
- 12 | ||
- 14 | ||
- 15 | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '${{ matrix.node }}' | ||
|
||
- name: Set up npm cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.OS }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }} | ||
${{ runner.OS }}-node-v${{ matrix.node }}- | ||
- name: Install npm dependencies | ||
run: npm ci | ||
|
||
- name: Run Jest | ||
run: npm run test:jest | ||
if: matrix.node != env.NODE_COV | ||
|
||
- name: Run Jest with coverage | ||
run: npm run test:jest:cov | ||
if: matrix.node == env.NODE_COV | ||
|
||
- name: Run Coveralls | ||
uses: coverallsapp/github-action@master | ||
if: matrix.node == env.NODE_COV | ||
with: | ||
github-token: '${{ secrets.GITHUB_TOKEN }}' |
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
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,43 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- 'dependabot/**' | ||
pull_request: | ||
|
||
env: | ||
CI: true | ||
FORCE_COLOR: 2 | ||
NODE: 14 | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '${{ env.NODE }}' | ||
|
||
- name: Set up npm cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.OS }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }} | ||
${{ runner.OS }}-node-v${{ env.NODE }}- | ||
- name: Install npm dependencies | ||
run: npm ci | ||
|
||
- name: Run lint | ||
run: npm run lint | ||
|
||
- name: Test types | ||
run: npm run test:types |
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
This file was deleted.
Oops, something went wrong.
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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