Skip to content

Commit

Permalink
Merge 3807145 into 95a010a
Browse files Browse the repository at this point in the history
  • Loading branch information
bicknellr committed Jun 22, 2021
2 parents 95a010a + 3807145 commit 72bdfd1
Show file tree
Hide file tree
Showing 8 changed files with 830 additions and 391 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
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:
report-id: lit-html-1.x
path: results.json
pr-bench-name: this-change
base-bench-name: lit-html-1.x
90 changes: 90 additions & 0 deletions .github/workflows/tests.yml
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
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# lit-html
Efficient, Expressive, Extensible HTML templates in JavaScript

[![Build Status](https://travis-ci.org/lit/lit.svg?branch=lit-html-1.4.x)](https://travis-ci.org/Polymer/lit-html)
[![Build Status](https://github.com/lit/lit/actions/workflows/tests.yml/badge.svg?branch=lit-html-1.x)](https://github.com/lit/lit/actions/workflows/tests.yml?query=branch%3Alit-html-1.x)
[![Published on npm](https://img.shields.io/npm/v/lit-html.svg)](https://www.npmjs.com/package/lit-html)
[![Join our Slack](https://img.shields.io/badge/slack-join%20chat-4a154b.svg)](https://lit.dev/slack-invite/)
[![Mentioned in Awesome Lit](https://awesome.re/mentioned-badge.svg)](https://github.com/web-padawan/awesome-lit)
Expand Down

0 comments on commit 72bdfd1

Please sign in to comment.