Add nicer formatting to gate info #1884
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint code | |
on: [push, pull_request] | |
jobs: | |
skip_check: | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@v5 | |
with: | |
concurrent_skipping: 'same_content_newer' | |
skip_after_successful_duplicate: 'true' | |
ts_lint: | |
name: Lint TypeScript | |
runs-on: ubuntu-latest | |
needs: skip_check | |
if: needs.skip_check.outputs.should_skip != 'true' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
with: | |
path: | | |
timApp/node_modules | |
timApp/modules/jsrunner/server/node_modules | |
key: ${{ runner.os }}-eslint-npm-${{ hashFiles('**/package-lock.json') }} | |
- name: Install packages | |
run: | | |
npm i --global npm@6 | |
cd timApp | |
npm install | |
cd modules/jsrunner/server | |
npm install | |
- name: Lint main code | |
run: cd timApp && npm run lint | |
- name: Lint JSRunner | |
run: cd timApp/modules/jsrunner/server && npm run lint | |
py_lint: | |
name: Lint Python | |
runs-on: ubuntu-latest | |
env: | |
PYTHON_VERSION: "3.10" | |
needs: skip_check | |
if: needs.skip_check.outputs.should_skip != 'true' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install APT Packages | |
uses: awalsh128/[email protected] | |
with: | |
packages: libxmlsec1-dev libxmlsec1-openssl | |
version: "1.1" | |
- name: Install Poetry | |
run: pipx install poetry | |
- name: Setup Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "${{ env.PYTHON_VERSION }}" | |
cache: poetry | |
- name: Install dependencies | |
run: | | |
poetry env use "${{ env.PYTHON_VERSION }}" | |
poetry install --only=dev | |
- name: Run MyPy | |
run: .venv/bin/mypy -p timApp -p tim_common |