-
Notifications
You must be signed in to change notification settings - Fork 881
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lit-html-1.x
: Run tests on GitHub actions (#1967)
* Copy test workflow from main branch. * Update test workflows to work with the lit-html-1.x branch. * Run local tests in XVFB * Update `actions/setup-node` and node version. * Remove 'benchmarks.yml' reference in comments. * Delete `.travis.yml` and `travis-bench.sh`. * Initial attempt at porting the benchmarks to a GitHub action. * Update tachometer. * Copy benchmarks workflow from main branch. * Update benchmark workflow to work with the lit-html-1.x branch. * Fix node_modules key. * Update to `actions/setup-node@v2`. * Use `git+https` protocol to avoid SSH which doesn't seem to work. * Move tachometer config to an external file. * Fix benchmark names in report action. * Update chromedriver. * Update URLs and references in tachometer.json . * Update ref in tachometer.json . * Update badge in README.md . * Remove `report-id` field from Tachometer reporter step.
- Loading branch information
Showing
8 changed files
with
829 additions
and
391 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,47 @@ | ||
name: Benchmarks | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
benchmarks: | ||
name: benchmarks | ||
|
||
# We can't currently run benchmarks on PRs from forked repos, because the | ||
# tachometer action reports results by posting a comment, and we can't post | ||
# comments without a github token. | ||
if: github.event.pull_request == null || github.event.pull_request.head.repo.full_name == github.repository | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
|
||
- name: Restore node_modules | ||
id: cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
# Bump the number after `lit-1.x-node-modules` to force a cache | ||
# update. Note there are multiple cache actions in `tests.yml` that | ||
# should all keep keys in sync. | ||
key: lit-1.x-node-modules-0-${{ runner.os }}-${{ hashFiles('package-lock.json') }} | ||
|
||
- name: NPM install | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: npm ci | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Benchmark | ||
run: npx tach --config tachometer.json --json-file results.json | ||
|
||
- name: Report | ||
uses: andrewiggins/tachometer-reporter-action@v2 | ||
with: | ||
path: results.json | ||
pr-bench-name: this-change | ||
base-bench-name: lit-html-1.x |
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,90 @@ | ||
name: Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
|
||
- run: npm ci | ||
|
||
- run: >- | ||
npm run format && git diff --exit-code || (echo -e '\n\033[31mERROR:\033[0m | ||
Project is not formatted. Please run "npm run format".' && false) | ||
tests-local: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
|
||
- name: Restore node_modules | ||
id: cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
# Bump the number after `lit-1.x-node-modules` to force a cache | ||
# update. Note there are cache actions in other jobs in this file that | ||
# should all keep keys in sync. | ||
key: lit-1.x-node-modules-0-${{ runner.os }}-${{ hashFiles('package-lock.json') }} | ||
|
||
- name: NPM install | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: npm ci | ||
|
||
- name: Install XVFB | ||
run: sudo apt-get install xvfb | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Test | ||
run: xvfb-run npx wct --npm | ||
|
||
tests-sauce: | ||
# We can't run Sauce tests on PRs from forked repos, since they don't have | ||
# access to secrets. | ||
if: github.event.pull_request == null || github.event.pull_request.head.repo.full_name == github.repository | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
|
||
- name: Restore node_modules | ||
id: cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
# Bump the number after `lit-1.x-node-modules` to force a cache | ||
# update. Note there are cache actions in other jobs in this file that | ||
# should all keep keys in sync. | ||
key: lit-1.x-node-modules-0-${{ runner.os }}-${{ hashFiles('package-lock.json') }} | ||
|
||
- name: NPM install | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: npm ci | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Test | ||
env: | ||
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} | ||
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} | ||
run: npx wct -s 'windows 10/microsoftedge@17' -s 'windows 10/microsoftedge@15' -s 'macos 10.13/safari@11' -s 'macos 10.12/safari@10' -s 'windows 8.1/internet explorer@11' -s 'Linux/chrome@41' --npm |
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
Oops, something went wrong.