From 07ac8957c8a207a6b3e17566b79bcc6488d04c52 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 27 Jul 2022 20:07:33 -0700 Subject: [PATCH] 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. --- .github/workflows/black.yml | 13 ------------- .github/workflows/build.yml | 6 +++--- .github/workflows/lint.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/release.yml | 6 +++--- 4 files changed, 34 insertions(+), 19 deletions(-) delete mode 100644 .github/workflows/black.yml create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml deleted file mode 100644 index 30465013..00000000 --- a/.github/workflows/black.yml +++ /dev/null @@ -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" \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d49fde20..caf19a91 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,9 @@ name: Build on: [push, pull_request] jobs: + lint: + uses: ./.github/workflows/lint.yml + build: runs-on: windows-latest steps: @@ -16,9 +19,6 @@ jobs: - name: Set up JS environment uses: ./.github/actions/setup-liberation-js - - name: mypy - uses: ./.github/actions/mypy - - name: Set build number run: | [IO.File]::WriteAllLines($pwd.path + "\resources\buildnumber", $env:GITHUB_RUN_NUMBER) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..179164bc --- /dev/null +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8a67a0a0..e7683d56 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,9 @@ on: tags: ["*"] jobs: + lint: + uses: ./.github/workflows/lint.yml + build: runs-on: windows-latest steps: @@ -18,9 +21,6 @@ jobs: - name: Set up JS environment uses: ./.github/actions/setup-liberation-js - - name: mypy - uses: ./.github/actions/mypy - - name: Finalize build run: | New-Item -ItemType file resources\final