Skip to content

Commit

Permalink
workflows: split CodeQL, upgrade action packages
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthvp committed Dec 16, 2023
1 parent 9f91bd8 commit 2437b38
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 49 deletions.
28 changes: 8 additions & 20 deletions .github/workflows/ci-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,41 @@ on:
paths:
- 'src/**'
- 'tests/**'
- 'package.json'
- 'package-lock.json'
- '.github/workflows/ci-pull-request.yml'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js 16.x
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
- run: npm ci
- run: npm run lint
- run: npm run build
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: build
path: build

code_ql:
runs-on: ubuntu-latest
name: CodeQL
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: javascript
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 16.x]
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Setup MediaWiki instance using Docker for integration tests
run: npm run setuplocalwiki
- run: npm ci
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
- run: npm run test:localwiki && npm run test:nowiki
46 changes: 20 additions & 26 deletions .github/workflows/ci-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
paths:
- 'src/**'
- 'tests/**'
- 'package.json'
- 'package-lock.json'
- '.github/workflows/ci-push.yml'
schedule:
- cron: '0 5 * * 1'
Expand All @@ -17,15 +19,15 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js 16.x
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
- run: npm ci
- run: npm run lint
- run: npm run build
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: build
path: build
Expand All @@ -34,52 +36,41 @@ jobs:
env:
AUTH_JSON: ${{secrets.AUTH_JSON}}

code_ql:
runs-on: ubuntu-latest
name: CodeQL
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: javascript
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 16.x, 18.x]
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Setup MediaWiki instance using Docker for integration tests
run: npm run setuplocalwiki
- run: npm ci
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
- run: npm run test
env:
AUTH_JSON: ${{secrets.AUTH_JSON}}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: coverage
name: coverage_${{ matrix.node-version }}
path: coverage

coveralls:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: coverage_18.x
path: coverage
- name: Coveralls
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -88,7 +79,10 @@ jobs:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: coverage_18.x
path: coverage
- name: Zip coverage report
run: |
mv coverage/lcov-report/* coverage
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/code-ql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CodeQL

on:
pull_request:
branches: [master]
paths:
- 'src/**'
- 'tests/**'
push:
branches: [master]
paths:
- 'src/**'
- 'tests/**'
schedule:
- cron: '0 5 * * 1'
workflow_dispatch:

jobs:
code_ql:
runs-on: ubuntu-latest
name: CodeQL
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: javascript
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
2 changes: 1 addition & 1 deletion .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install dependencies
run: |
npm ci
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
registry-url: https://registry.npmjs.org/
Expand Down

0 comments on commit 2437b38

Please sign in to comment.