From 17a85aa4c1592115e896b1e13a0ac4f99aa94e06 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 20 Oct 2022 16:43:25 -0700 Subject: [PATCH 1/6] Add matrix for operating systems --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae67061..85d4997 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,11 +10,13 @@ on: jobs: build: - runs-on: ubuntu-latest strategy: matrix: + operating-system: [ubuntu-latest, windows-latest, macos-latest] python-version: [3.6, 3.7, 3.8, 3.9, '3.10'] + runs-on: ${{ matrix.operating-system }} + steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} From b16b67f6686d72b279f5e09e38bb4aa975d31c19 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 20 Oct 2022 16:46:44 -0700 Subject: [PATCH 2/6] Skip lgeiger/black-action for non-Linux runners --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 85d4997..4983d2f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,7 @@ jobs: uses: lgeiger/black-action@v1.0.1 with: args: ". --check" + if: ${{ matrix.operating-system }} == 'ubuntu-latest' - name: Mypy Check uses: jpetrucciani/mypy-check@0.761 with: From cd4105e6d64d940b172bed2dc09e0d9e2cc8c60e Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 20 Oct 2022 16:53:51 -0700 Subject: [PATCH 3/6] Use runner.os in conditional for Black Code Formatter build step --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4983d2f..7669055 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,7 @@ jobs: uses: lgeiger/black-action@v1.0.1 with: args: ". --check" - if: ${{ matrix.operating-system }} == 'ubuntu-latest' + if: runner.os == 'Linux' - name: Mypy Check uses: jpetrucciani/mypy-check@0.761 with: From 63991a0e372873fd25fe62c5580a2217e6e066f0 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 20 Oct 2022 16:56:37 -0700 Subject: [PATCH 4/6] Use runner.os in conditional For Mypy check build step --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7669055..fa7deea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,7 @@ jobs: matrix: operating-system: [ubuntu-latest, windows-latest, macos-latest] python-version: [3.6, 3.7, 3.8, 3.9, '3.10'] + fail-fast: false runs-on: ${{ matrix.operating-system }} @@ -32,6 +33,7 @@ jobs: uses: jpetrucciani/mypy-check@0.761 with: path: 'src' + if: runner.os == 'Linux' - name: Install poetry run: | python -m pip install --upgrade pip From 260fec244e71625cacb4eb6671237adea5541590 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 20 Oct 2022 16:57:39 -0700 Subject: [PATCH 5/6] Fix typo in workflow --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa7deea..6760ec0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,10 +11,10 @@ jobs: build: strategy: + fail-fast: false matrix: operating-system: [ubuntu-latest, windows-latest, macos-latest] python-version: [3.6, 3.7, 3.8, 3.9, '3.10'] - fail-fast: false runs-on: ${{ matrix.operating-system }} From 89548434b1924f2a52a041d9c4059276af92d5eb Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 20 Oct 2022 17:06:42 -0700 Subject: [PATCH 6/6] Add job for linux-only actions They are check actions not critical for the build so makes sense to have them in a different job running on Linux (since the actions require linux) and then have the build job depend on the check job. --- .github/workflows/build.yml | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6760ec0..8ed685e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,8 +8,24 @@ on: branches: [ master ] jobs: - build: + check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Black Code Formatter + uses: lgeiger/black-action@v1.0.1 + with: + args: ". --check" + - name: Mypy Check + uses: jpetrucciani/mypy-check@0.761 + with: + path: 'src' + + build: + needs: [check] strategy: fail-fast: false matrix: @@ -20,28 +36,22 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - - name: Black Code Formatter - uses: lgeiger/black-action@v1.0.1 - with: - args: ". --check" - if: runner.os == 'Linux' - - name: Mypy Check - uses: jpetrucciani/mypy-check@0.761 - with: - path: 'src' - if: runner.os == 'Linux' + - name: Install poetry run: | python -m pip install --upgrade pip python -m pip install poetry + - name: Install dependencies run: | poetry install poetry check + - name: Build package run: | poetry build