diff --git a/.github/workflows/css-lint.yml b/.github/workflows/css-lint.yml index 8ca2fb6a2c..372c55247e 100644 --- a/.github/workflows/css-lint.yml +++ b/.github/workflows/css-lint.yml @@ -7,10 +7,6 @@ on: - '**/*.css' - '.github/workflows/css-lint.yml' pull_request: - types: - - opened - - reopened - - synchronize paths: - '*.json' - '**/*.css' @@ -20,18 +16,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') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Add Custom Problem Matcher run: | - echo "::add-matcher::.github/matchers/${{ github.job }}.json" + echo "::add-matcher::.github/matchers/${{ github.job }}.json" + - name: Install Dependencies run: | - npm install + npm ci + - name: npm run stylelint run: | npm run stylelint diff --git a/.github/workflows/javascript-lint.yml b/.github/workflows/javascript-lint.yml index 198246a8ea..873f059284 100644 --- a/.github/workflows/javascript-lint.yml +++ b/.github/workflows/javascript-lint.yml @@ -7,10 +7,6 @@ on: - '**/*.json' - '.github/workflows/javascript-lint.yml' pull_request: - types: - - opened - - reopened - - synchronize paths: - '**/*.js' - '**/*.json' @@ -20,15 +16,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 diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index 0c6ac29696..ed10452761 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -7,10 +7,6 @@ on: - '**/*.md' - '.github/workflows/markdown-lint.yml' pull_request: - types: - - opened - - reopened - - synchronize paths: - '*.json' - '**/*.md' @@ -20,18 +16,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 diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml index e7307ddd8e..419a738e9b 100644 --- a/.github/workflows/python-lint.yml +++ b/.github/workflows/python-lint.yml @@ -7,10 +7,6 @@ on: - '.github/workflows/python-lint.yml' - 'requirements.txt' pull_request: - types: - - opened - - reopened - - synchronize paths: - '**/*.py' - '.github/workflows/python-lint.yml' @@ -20,43 +16,43 @@ 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" @@ -64,21 +60,21 @@ jobs: # 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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f3c80f1fa9..7c3d5d22c8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,10 +9,6 @@ on: - 'ui/raidboss/**' - '.github/workflows/test.yml' pull_request: - types: - - opened - - reopened - - synchronize paths: - '**/*.js' - '**/*.py' @@ -24,19 +20,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 diff --git a/requirements.txt b/requirements.txt index c2ab8a91d5..48cf65bba1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ # Linting, formatting black==19.10b0 pylint==2.5.3 + # dependencies for utils/*.py PyYAML requests