Skip to content

Commit

Permalink
fix: setup ci in new repo
Browse files Browse the repository at this point in the history
  • Loading branch information
daKmoR committed Oct 20, 2020
1 parent a94c13f commit 4851530
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 692 deletions.
3 changes: 3 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## What I did

1.
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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/es-dev-server'
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 "[email protected]"
git config --global user.name "Modern Web"
- name: Release & Publish
run: npm run release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/verify-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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 package
run: yarn build

- name: Test
run: yarn test
41 changes: 41 additions & 0 deletions .github/workflows/verify-windows.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"scripts": {
"build": "tsc",
"generate-certificates": "node scripts/generate-certificates.js",
"prepublishOnly": "npm run build && ../../scripts/insert-header.js",
"release": "standard-version && git push --follow-tags origin master && npm publish",
"start:babel": "node dist/cli.js -c demo/babel/server.js --open --watch",
"start:base-path": "node dist/cli.js -c demo/base-path/server.js",
"start:dedupe": "node dist/cli.js -c demo/dedupe/server.js --open --watch",
Expand Down Expand Up @@ -133,7 +133,6 @@
"@babel/plugin-transform-modules-systemjs": "^7.10.5",
"@babel/preset-typescript": "^7.8.3",
"@babel/register": "^7.9.0",
"@open-wc/eslint-config": "^3.0.0",
"@types/koa__cors": "^3.0.1",
"@types/mocha": "^8.0.3",
"@types/node-fetch": "^2.3.7",
Expand All @@ -142,8 +141,6 @@
"abort-controller": "^3.0.0",
"buffer": "^5.4.3",
"chai": "^4.2.0",
"eslint": "^7.11.0",
"eslint-config-prettier": "^6.13.0",
"koa-proxies": "^0.8.1",
"lit-element": "^2.4.0",
"lit-html": "^1.3.0",
Expand Down
Loading

0 comments on commit 4851530

Please sign in to comment.