Skip to content

Commit

Permalink
fix(action): add test and release action
Browse files Browse the repository at this point in the history
  • Loading branch information
sQVe committed Mar 7, 2021
1 parent 64c733e commit ef29e9d
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/test-and-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Test and release

on: [pull_request, push]

jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x]

steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive

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

- name: Install dependencies
run: npm ci

- name: Run linter
run: npm run lint
env:
CI: true

- name: Run build
run: npm run build
env:
CI: true

- name: Run tests
run: |
npm run test
npm run test:integration
npm run test:coverage:upload
env:
CI: true
FORCE_COLOR: true

release:
name: Release
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: [test]
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive

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

- name: Install dependencies
run: npm ci

- name: Release new version to NPM
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release --no-install

0 comments on commit ef29e9d

Please sign in to comment.