Skip to content

Commit

Permalink
workflows – optimise and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthvp committed Jan 26, 2021
1 parent aafa25d commit 3851abc
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 50 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ indent_style = tab
insert_final_newline = true
max_line_length = 120
tab_width = 4

[*.yml]
indent_style = tab
indent_size = 2
56 changes: 30 additions & 26 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ name: "CodeQL"
on:
push:
branches: [ master ]
paths:
- 'build/**'
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
paths:
- 'build/**'

jobs:
analyze:
Expand All @@ -21,29 +25,29 @@ jobs:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
13 changes: 11 additions & 2 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: Docs deploy

on:
push:
branches: ['master']
branches: [ master ]
paths:
- 'src/**'
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -30,7 +32,14 @@ jobs:
- name: unzip and copy
uses: garygrossgarten/github-action-ssh@release
with:
command: cd /data/project/mwn && rm -rf docs && unzip docs.zip && rm -rf public_html/docs && rm -rf www/static/docs && cp -r docs public_html && cp -r docs www/static
command: >-
cd /data/project/mwn &&
rm -rf docs &&
unzip docs.zip &&
rm -rf public_html/docs &&
rm -rf www/static/docs &&
cp -r docs public_html &&
cp -r docs www/static
host: login.toolforge.org
username: ${{ secrets.TOOLFORGE_USERNAME }}
privateKey: ${{ secrets.TOOLFORGE_PRIVATE_KEY }}
48 changes: 28 additions & 20 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,36 @@
name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
push:
branches: [ master ]
paths:
- 'src/**'
- 'build/**'
- 'tests/**'
pull_request:
branches: [ master ]
paths:
- 'src/**'
- 'build/**'
- 'tests/**'
workflow_dispatch:

jobs:
build:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
strategy:
matrix:
node-version: [ 10.x, 12.x, 14.x ]

steps:
- 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-readonly
env:
AUTH_JSON: ${{secrets.AUTH_JSON}}
steps:
- 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-readonly && npm run test-ts
env:
AUTH_JSON: ${{secrets.AUTH_JSON}}
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: NPM publish

on:
release:
types: [created]
types: [ created ]

jobs:
publish-npm:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test-readonly": "cd tests && npx mocha bot.test.js batchOperations.bot.test.js category.test.js date.test.js file.test.js log.test.js login.bot.test.js oauth.test.js page.test.js static_utils.test.js suppl.bot.test.js title.test.js user.test.js wikitext.test.js",
"test": "nyc --reporter=lcov --reporter=text mocha tests/",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"test-ts": "ts-mocha -p tsconfig.json tests/ts/*",
"test-ts": "npx ts-mocha -p tsconfig.json tests/ts/*",
"docs": "npx typedoc src/bot.ts --out docs --ignoreCompilerErrors"
},
"repository": "git+https://github.com/siddharthvp/mwn.git",
Expand Down

0 comments on commit 3851abc

Please sign in to comment.