2023-11-13 09:11:28 +00:00
|
|
|
name: 'Merge to master'
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [master]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version: [14.x]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Get branch name (merge)
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
shell: bash
|
|
|
|
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Get branch name (pull request)
|
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
shell: bash
|
|
|
|
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2023-11-14 17:15:10 +00:00
|
|
|
- run: npm ci --legacy-peer-deps
|
2023-11-13 09:11:28 +00:00
|
|
|
- run: npm run build
|
|
|
|
- run: nyc npm test && nyc report --reporter=text-lcov | ./node_modules/coveralls/bin/coveralls.js
|
|
|
|
env:
|
|
|
|
COVERALLS_SERVICE_NAME: GithubActions
|
|
|
|
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
|
|
|
COVERALLS_GIT_BRANCH: ${{ env.BRANCH_NAME }}
|