mirror of
https://github.com/lancedikson/bowser
synced 2024-10-27 20:34:22 +00:00
.
This commit is contained in:
parent
f09411489c
commit
6720ba2635
36
.github/workflows/merge-to-master.yml
vendored
Normal file
36
.github/workflows/merge-to-master.yml
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
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 }}
|
||||
- run: npm ci
|
||||
- run: npm run test-ci
|
||||
env:
|
||||
COVERALLS_SERVICE_NAME: GithubActions
|
||||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
||||
COVERALLS_GIT_BRANCH: ${{ env.BRANCH_NAME }}
|
27
.github/workflows/nodejs.yml
vendored
27
.github/workflows/nodejs.yml
vendored
@ -1,27 +0,0 @@
|
||||
name: Node CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.16.3]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: npm ci, build, and test
|
||||
run: |
|
||||
npm ci
|
||||
npm run lint
|
||||
npm run build
|
||||
npm test
|
||||
env:
|
||||
CI: true
|
42
.github/workflows/pull-request.yml
vendored
Normal file
42
.github/workflows/pull-request.yml
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
name: 'Pull Request'
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, reopened, synchronize]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node: [12, 14, 16, 18, 20]
|
||||
name: Node ${{ matrix.node }}
|
||||
steps:
|
||||
- name: 'Checkout latest code'
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Set up node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Run tests
|
||||
run: npm run test
|
||||
|
||||
lint:
|
||||
name: 'ESLint'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout latest code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Set up node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16'
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
- name: Run ESLint
|
||||
run: npm run lint:check
|
@ -72,7 +72,8 @@
|
||||
"generate-and-deploy-docs": "npm run generate-docs && gh-pages --dist docs --dest docs",
|
||||
"watch": "webpack --watch --config webpack.config.js",
|
||||
"prepublishOnly": "npm run build",
|
||||
"lint": "eslint ./src",
|
||||
"lint:check": "eslint ./src",
|
||||
"lint:fix": "eslint --fix ./src",
|
||||
"testem": "testem",
|
||||
"test": "nyc --reporter=html --reporter=text ava",
|
||||
"test:watch": "ava --watch",
|
||||
|
Loading…
Reference in New Issue
Block a user