Split Python linting into separate jobs.

This is just the first step to prove the concept. Most of the work done
in our workflows can be split into separate jobs to parallelize the
workflow. This will also make the checks page more readable.

This change alone probably won't speed up CI much.
This commit is contained in:
Dan Albert 2022-07-27 20:07:33 -07:00
parent 2bd39bd9f5
commit 07ac8957c8
4 changed files with 34 additions and 19 deletions

View File

@ -1,13 +0,0 @@
name: Lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: psf/black@stable
with:
args: ". --check"

View File

@ -3,6 +3,9 @@ name: Build
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
lint:
uses: ./.github/workflows/lint.yml
build: build:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
@ -16,9 +19,6 @@ jobs:
- name: Set up JS environment - name: Set up JS environment
uses: ./.github/actions/setup-liberation-js uses: ./.github/actions/setup-liberation-js
- name: mypy
uses: ./.github/actions/mypy
- name: Set build number - name: Set build number
run: | run: |
[IO.File]::WriteAllLines($pwd.path + "\resources\buildnumber", $env:GITHUB_RUN_NUMBER) [IO.File]::WriteAllLines($pwd.path + "\resources\buildnumber", $env:GITHUB_RUN_NUMBER)

28
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: Python lint
on: workflow_call
jobs:
black:
name: Black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: psf/black@stable
with:
args: ". --check"
mypy:
name: Type checking
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python environment
uses: ./.github/actions/setup-liberation-python
- name: mypy
uses: ./.github/actions/mypy

View File

@ -5,6 +5,9 @@ on:
tags: ["*"] tags: ["*"]
jobs: jobs:
lint:
uses: ./.github/workflows/lint.yml
build: build:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
@ -18,9 +21,6 @@ jobs:
- name: Set up JS environment - name: Set up JS environment
uses: ./.github/actions/setup-liberation-js uses: ./.github/actions/setup-liberation-js
- name: mypy
uses: ./.github/actions/mypy
- name: Finalize build - name: Finalize build
run: | run: |
New-Item -ItemType file resources\final New-Item -ItemType file resources\final