Skip to content

Commit

Permalink
Merge pull request #31 from joe-castle/feature-29-github-actions
Browse files Browse the repository at this point in the history
ci(travis): upgrading from Travis to GitHub Actions
  • Loading branch information
joe-castle committed Apr 19, 2021
2 parents 1786edf + a71c6bb commit 68faca1
Show file tree
Hide file tree
Showing 4 changed files with 253 additions and 69 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,32 @@
name: Release

on:
pull_request:
types: [ closed ]
branches: [ master ]

jobs:
release:
name: Release

runs-on: ubuntu-latest

if: ${{ github.event.pull_request.merged }}

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 15
- name: Install dependencies
run: npm ci
- uses: actions/download-artifact@v2
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
43 changes: 43 additions & 0 deletions .github/workflows/test-build.yml
@@ -0,0 +1,43 @@
name: Test, Build and Report Coverage

on:
push:
branches: [ master, deploy, feature/*, fix/*, release/* ]
pull_request:
branches: [ master, deploy ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Lint source files
run: npm run lint
- name: Run tests and produce coverage
run: npm run test:coverage
- name: Build source files
run: npm run build
- uses: actions/upload-artifact@v2
if: ${{ success() && github.ref == 'refs/heads/master' }}
path: |
dist/**
lib/**
es/**
types/**
- name: Coveralls report
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage/lcov.info
240 changes: 176 additions & 64 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions package.json
Expand Up @@ -24,12 +24,9 @@
"lint": "ts-standard --fix \"src/**/*.ts\" \"test/**/*.js\"",
"test": "jest",
"test:watch": "npm run test -- --watch",
"coveralls": "npm run check:coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage",
"check:src": "npm run lint && npm test",
"check:coverage": "npm test -- --coverage",
"test:coverage": "npm test -- --coverage",
"build": "rollup -c",
"cm": "cz",
"prepublishOnly": "npm run clean && npm run check:src && npm run build",
"prepare": "husky install"
},
"devDependencies": {
Expand All @@ -40,7 +37,7 @@
"@commitlint/cli": "^12.1.1",
"@commitlint/config-conventional": "^12.1.1",
"@types/jest": "^26.0.22",
"coveralls": "^3.0.2",
"commitizen": "^4.2.3",
"cz-conventional-changelog": "^3.3.0",
"husky": "^6.0.0",
"jest": "^26.6.3",
Expand Down

0 comments on commit 68faca1

Please sign in to comment.