Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yak shaving CI #2060

Merged
merged 9 commits into from
Dec 4, 2020
23 changes: 14 additions & 9 deletions .github/workflows/css-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
- '**/*.css'
- '.github/workflows/css-lint.yml'
pull_request:
types:
- opened
- reopened
- synchronize
paths:
- '**/*.css'
- '.github/workflows/css-lint.yml'
Expand All @@ -18,18 +14,27 @@ jobs:
stylelint:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v2-beta
- uses: actions/checkout@v1

- uses: actions/setup-node@v2-beta
with:
node-version: '12'

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
ayyaruq marked this conversation as resolved.
Show resolved Hide resolved
restore-keys: |
${{ runner.os }}-node-

- name: Add Custom Problem Matcher
run: |
echo "::add-matcher::.github/matchers/${{ github.job }}.json"

- name: Install Dependencies
run: |
npm install
npm ci

- name: npm run stylelint
run: |
npm run stylelint
22 changes: 13 additions & 9 deletions .github/workflows/javascript-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
- '**/*.js'
- '.github/workflows/javascript-lint.yml'
pull_request:
types:
- opened
- reopened
- synchronize
paths:
- '**/*.js'
- '.github/workflows/javascript-lint.yml'
Expand All @@ -18,15 +14,23 @@ jobs:
eslint:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v2-beta
- uses: actions/checkout@v1

- uses: actions/setup-node@v2-beta
with:
node-version: '12'

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install Dependencies
run: |
npm install
npm ci

- name: npm run lint
run: |
npm run lint
23 changes: 14 additions & 9 deletions .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
- '**/*.md'
- '.github/workflows/markdown-lint.yml'
pull_request:
types:
- opened
- reopened
- synchronize
paths:
- '**/*.md'
- '.github/workflows/markdown-lint.yml'
Expand All @@ -18,18 +14,27 @@ jobs:
markdownlint:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v2-beta
- uses: actions/checkout@v1

- uses: actions/setup-node@v2-beta
with:
node-version: '12'

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Add Custom Problem Matcher
run: |
echo "::add-matcher::.github/matchers/${{ github.job }}.json"

- name: Install Dependencies
run: |
npm install
npm ci

- name: npm run markdownlint
run: |
npm run markdownlint
44 changes: 20 additions & 24 deletions .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
- '**/*.py'
- '.github/workflows/python-lint.yml'
pull_request:
types:
- opened
- reopened
- synchronize
paths:
- '**/*.py'
- '.github/workflows/python-lint.yml'
Expand All @@ -18,65 +14,65 @@ jobs:
black:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v1
- name: Setup Python
uses: actions/setup-python@v2
- uses: actions/checkout@v1

- uses: actions/setup-python@v2
with:
python-version: '3.7'

# Cache pip dependencies
# See also: https://github.com/actions/cache/blob/main/examples.md#python---pip
- name: Get pip cache dir
id: pip-cache
id: pip-dir
run: |
echo "::set-output name=dir::$(pip cache dir)"

- name: pip cache
uses: actions/cache@v2
- uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: cactbot-pip-${{ hashFiles('**/requirements.txt') }}
path: ${{ steps.pip-dir.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
cactbot-pip-
${{ runner.os }}-pip-

- name: Install Dependencies
run: |
pip install -r requirements.txt

- name: black **/*.py --line-length 100 --check --diff
run: |
black **/*.py --line-length 100 --check --diff

pylint:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v1
- name: Setup Python
uses: actions/setup-python@v2
- uses: actions/checkout@v1

- uses: actions/setup-python@v2
with:
python-version: '3.7'

- name: Add Custom Problem Matcher
run: |
echo "::add-matcher::.github/matchers/${{ github.job }}.json"

# Cache pip dependencies
# See also: https://github.com/actions/cache/blob/main/examples.md#python---pip
- name: Get pip cache dir
id: pip-cache
id: pip-dir
run: |
echo "::set-output name=dir::$(pip cache dir)"

- name: pip cache
uses: actions/cache@v2
- uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: cactbot-pip-${{ hashFiles('**/requirements.txt') }}
path: ${{ steps.pip-dir.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
cactbot-pip-
${{ runner.os }}-pip-

- name: Install Dependencies
run: |
pip install -r requirements.txt

- name: pylint **/*.py --errors-only
run: |
pylint **/*.py --errors-only
26 changes: 15 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ on:
- 'ui/raidboss/**'
- '.github/workflows/test.yml'
pull_request:
types:
- opened
- reopened
- synchronize
paths:
- '**/*.js'
- '**/*.py'
Expand All @@ -22,19 +18,27 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v2-beta
- uses: actions/checkout@v1

- uses: actions/setup-node@v2-beta
with:
node-version: '12'
- name: Setup Python
uses: actions/setup-python@v2

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- uses: actions/setup-python@v2
with:
python-version: '3.7'

- name: Install Dependencies
run: |
npm install
npm ci

- name: npm test
run: |
npm test
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Linting, formatting
black==19.10b0
pylint==2.5.3

# dependencies for utils/*.py
PyYAML
requests