Skip to content

Commit

Permalink
chore: move to github actions and changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
daKmoR committed Oct 25, 2020
1 parent 6343304 commit 1ed49ff
Show file tree
Hide file tree
Showing 189 changed files with 949 additions and 2,714 deletions.
10 changes: 10 additions & 0 deletions .changeset/config.json
@@ -0,0 +1,10 @@
{
"$schema": "https://unpkg.com/@changesets/config@1.1.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"linked": [],
"ignore": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch"
}
102 changes: 0 additions & 102 deletions .circleci/config.yml

This file was deleted.

7 changes: 1 addition & 6 deletions .eslintignore
Expand Up @@ -3,11 +3,6 @@ coverage/
dist
tsc-dist
stats.html
/packages/create/src/generators/*/templates/**/*
/packages/import-maps-generate/test/assets/**/node_modules
/packages/**/test/**/snapshots
/packages/es-dev-server/test/fixtures/**/*
/packages/karma-esm/src/esm-debug.html
/packages/karma-esm/src/esm-context.html
/packages/**/test-node/**/snapshots
/packages/demoing-storybook/storybook-static/**/*
/packages/**/demo/**/*
7 changes: 6 additions & 1 deletion .eslintrc.js
@@ -1,9 +1,14 @@
module.exports = {
extends: ['./packages/eslint-config/index.js', require.resolve('eslint-config-prettier')],
rules: {
'lit/no-useless-template-literals': 'off',
},
overrides: [
{
files: ['**/test/**/*.js', '**/*.config.js'],
files: ['**/test-node/**/*.js', '**/test-web/**/*.js', '**/*.config.js'],
rules: {
'lit/no-invalid-html': 'off',
'lit/binding-positions': 'off',
'no-console': 'off',
'no-unused-expressions': 'off',
'class-methods-use-this': 'off',
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,53 @@
name: Release

on:
push:
branches:
- master

jobs:
release:
# Prevents changesets action from creating a PR on forks
if: github.repository == 'open-wc/open-wc'
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Setup Node.js 12.x
uses: actions/setup-node@master
with:
node-version: 12.x
registry-url: 'https://registry.npmjs.org'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: yarn --frozen-lockfile

- name: Build types
run: yarn build:types

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@master
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
93 changes: 93 additions & 0 deletions .github/workflows/verify-node.yml
@@ -0,0 +1,93 @@
name: Verify changes

on: pull_request

jobs:
verify:
name: Verify changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Node 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn --frozen-lockfile

- name: Lint
run: yarn lint

web-tests:
name: Web tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Node 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn --frozen-lockfile

- uses: microsoft/playwright-github-action@v1

- name: Test
run: yarn test:web

node-tests:
name: Node tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x]
steps:
- uses: actions/checkout@v2

- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn --frozen-lockfile

- name: Test
run: yarn test:node
6 changes: 1 addition & 5 deletions .prettierignore
Expand Up @@ -5,11 +5,7 @@ dist
tsc-dist
stats.html
packages/semantic-dom-diff/bundle/get-diffable-html.js
packages/**/test/**/snapshots
/packages/es-dev-server/test/fixtures/**/*
/packages/es-dev-server/demo/**/*
/packages/karma-esm/src/esm-debug.html
/packages/karma-esm/src/esm-context.html
packages/**/test-node/**/snapshots
/packages/demoing-storybook/storybook-static/**/*
/packages/rollup-plugin-input-html/test/fixtures/**/*
/packages/rollup-plugin-html/dist/**/*
Expand Down
3 changes: 0 additions & 3 deletions commitlint.config.js

This file was deleted.

1 change: 0 additions & 1 deletion husky.config.js
@@ -1,6 +1,5 @@
module.exports = {
hooks: {
'pre-commit': 'lint-staged',
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
},
};
12 changes: 0 additions & 12 deletions lerna.json

This file was deleted.

26 changes: 11 additions & 15 deletions package.json
Expand Up @@ -3,7 +3,6 @@
"private": true,
"license": "MIT",
"scripts": {
"build": "lerna run build",
"build:types": "tsc -p tsconfig.build.types.json",
"codelabs:build": "node ./packages/codelabs/build-codelabs.js",
"docs:build": "rimraf _site && node cli-build.js",
Expand All @@ -17,14 +16,15 @@
"lint:prettier": "prettier \"**/*.{js,md}\" \"**/package.json\" --check",
"lint:types": "tsc",
"lint:versions": "node ./scripts/lint-versions.js",
"postinstall": "npm run build && patch-package",
"publish": "lerna publish --message 'chore: release new versions'",
"site:build": "npm run docs:build && lerna run site:build",
"postinstall": "patch-package",
"release": "changeset publish && yarn format",
"site:build": "npm run docs:build && node scripts/workspaces-scripts-bin.mjs site:build",
"site:start": "npm run docs:start",
"start": "npm run docs:start",
"test": "yarn test:browser && yarn test:node",
"test:browser": "web-test-runner",
"test:node": "lerna run test:node --stream",
"test": "yarn test:web && yarn test:node",
"test:node": "mocha \"packages/*/test-node/**/*.test.{ts,js,mjs,cjs}\" --exit --retries 3",
"test:node:watch": "mocha \"packages/*/test-node/**/*.test.{ts,js,mjs,cjs}\" --watch",
"test:web": "web-test-runner",
"update-dependency": "node scripts/update-dependency.js"
},
"dependencies": {
Expand All @@ -33,9 +33,7 @@
"devDependencies": {
"@11ty/eleventy": "^0.11.0",
"@11ty/eleventy-plugin-syntaxhighlight": "^3.0.1",
"@commitlint/cli": "7.2.1",
"@commitlint/config-conventional": "7.1.2",
"@commitlint/config-lerna-scopes": "7.2.1",
"@changesets/cli": "^2.11.1",
"@github/clipboard-copy-element": "^1.1.1",
"@types/aria-query": "^4.2.0",
"@types/chai": "^4.2.11",
Expand All @@ -47,6 +45,7 @@
"@web/test-runner-playwright": "^0.6.4",
"babel-eslint": "^10.0.3",
"chai": "^4.2.0",
"concurrently": "^5.2.0",
"core-js": "2.6.10",
"eslint": "^7.6.0",
"eslint-config-airbnb-base": "^14.0.0",
Expand All @@ -57,7 +56,6 @@
"eslint-plugin-wc": "^1.2.0",
"fs-extra": "^8.1.0",
"husky": "3.0.0",
"lerna": "3.4.3",
"lint-staged": "^10.0.0",
"lit-element": "^2.2.1",
"mocha": "^6.2.2",
Expand All @@ -79,12 +77,10 @@
"lint-staged": {
"*.js": [
"eslint --fix",
"prettier --write",
"git add"
"prettier --write"
],
"*.md": [
"prettier --write",
"git add"
"prettier --write"
]
},
"workspaces": [
Expand Down

0 comments on commit 1ed49ff

Please sign in to comment.