Skip to content

Commit

Permalink
Migrate to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslansagitov committed Aug 12, 2022
1 parent d438f33 commit 2cf7230
Show file tree
Hide file tree
Showing 5 changed files with 2,700 additions and 1,930 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: deploy

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Cache
uses: actions/cache@v3
id: cache-npm
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: NodeJS
uses: actions/setup-node@v3
with:
node-version: '16'
registry-url: https://registry.npmjs.org/

- name: Install
run: |
node --version
npm --version
npm ci
- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
78 changes: 78 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: test

on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
env:
DISPLAY: ':0'
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Cache
uses: actions/cache@v3
id: cache-npm
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: NodeJS
uses: actions/setup-node@v3
with:
node-version: '16'
registry-url: https://registry.npmjs.org/

- name: Install
run: |
node --version
npm --version
npm ci
- name: Lint
run: |
npm run lint
npm run check-writing
- name: Install Chrome
uses: browser-actions/setup-chrome@latest

- name: Install Firefox
uses: browser-actions/setup-firefox@latest

- name: Start Xvfb
run: |
sudo apt-get install xvfb && \
Xvfb $DISPLAY &> /dev/null &
- name: Test
run: npm run coverage
env:
KARMA_BROWSERS: Firefox,Chrome

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{ github.workspace }}/coverage/lcov.info

- name: CodeClimate
uses: paambaati/codeclimate-action@v3.0.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: ${{ github.workspace }}/coverage/lcov.info:lcov
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
build
coverage
.nyc_output
Loading

0 comments on commit 2cf7230

Please sign in to comment.