chore: add CI

This commit is contained in:
Thomas Allmer
2020-10-18 18:06:51 +02:00
parent 39e9821e1c
commit a5746f4057
6 changed files with 1036 additions and 19 deletions

3
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,3 @@
## What I did
1.

53
.github/workflows/release.yml vendored Normal file
View File

@@ -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/create'
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 package
run: yarn build
- name: Setup Git User
run: |
git config --global user.email "hello@modern-web.dev"
git config --global user.name "Modern Web"
- name: Release & Publish
run: npm run release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

42
.github/workflows/verify-node.yml vendored Normal file
View File

@@ -0,0 +1,42 @@
name: Verify Node
on: pull_request
jobs:
verify-linux:
name: Verify linux
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: Build packages
run: yarn build
- name: Lint
run: yarn lint
- name: Test
run: yarn test

41
.github/workflows/verify-windows.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: Verify Windows
on: pull_request
jobs:
verify-windows:
name: Verify windows
runs-on: windows-latest
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v2
- name: Setup Node 12.x
uses: actions/setup-node@v1
with:
node-version: 12.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: Build
run: yarn build
- name: Test
run: yarn test

View File

@@ -1,6 +1,6 @@
{
"name": "@open-wc/create",
"version": "0.36.0",
"version": "0.37.0",
"publishConfig": {
"access": "public"
},
@@ -21,6 +21,7 @@
"lint": "npm run lint:eslint && npm run lint:prettier",
"lint:eslint": "eslint --ext .ts,.js,.mjs,.cjs .",
"lint:prettier": "prettier \"**/*.{ts,js,mjs,cjs,md}\" --check --ignore-path .eslintignore",
"release": "standard-version && git push --follow-tags origin master && npm publish",
"start": "npm run build && node ./dist/create.js",
"test": "npm run test:node",
"test:node": "mocha --require @babel/register",
@@ -57,9 +58,11 @@
"chai-fs": "^2.0.0",
"eslint": "^7.11.0",
"eslint-config-prettier": "^6.13.0",
"lit-element": "^2.4.0",
"mocha": "^6.2.2",
"onchange": "^5.2.0",
"prettier": "^2.1.2"
"prettier": "^2.1.2",
"standard-version": "^9.0.0"
},
"prettier": {
"singleQuote": true,

909
yarn.lock

File diff suppressed because it is too large Load Diff