From 333209ac4ea2814e129c6f38db9e677c2019eb2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Dahlgren?= Date: Sun, 13 Dec 2020 15:10:35 +0100 Subject: [PATCH] Migrate to GitHub Actions --- .github/workflows/codeql.yml | 37 ++++++++++++++++++++ .github/workflows/node.yml | 65 ++++++++++++++++++++++++++++++++++++ .travis.yml | 16 --------- 3 files changed, 102 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/node.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..c43120d --- /dev/null +++ b/.github/workflows/codeql.yml @@ -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 diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml new file mode 100644 index 0000000..6fa139e --- /dev/null +++ b/.github/workflows/node.yml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1fc42b5..0000000 --- a/.travis.yml +++ /dev/null @@ -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