Migrate to GitHub Actions

This commit is contained in:
Björn Dahlgren 2020-12-13 15:10:35 +01:00
parent 239ce6f379
commit 333209ac4e
3 changed files with 102 additions and 16 deletions

37
.github/workflows/codeql.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: "CodeQL"
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '45 21 * * 2'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
language:
- javascript
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

65
.github/workflows/node.yml vendored Normal file
View File

@ -0,0 +1,65 @@
name: Node.js CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version:
- 14.x
- 12.x
- 10.x
- 8.x
- 6.x
- 4.x
os:
- ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Cache npm dependencies
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ matrix.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ matrix.os }}-node-${{ matrix.node-version }}-
- name: Install npm dependencies
run: npm install
- name: Copy example config
run: cp config.js.example config.js
- name: Lint
run: npm run lint
- name: Test
run: npm test
env:
CI: true
- name: Webpack
run: ./node_modules/.bin/webpack

View File

@ -1,16 +0,0 @@
language: node_js
branches:
only:
- master
node_js:
- "12"
- "10"
- "8"
- "6"
- "4"
before_install:
- cp config.js.example config.js
script:
- npm run lint
- npm test
- ./node_modules/.bin/webpack