-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create separate receptorctl workflows with matrices (#1003)
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
- Loading branch information
Showing
3 changed files
with
125 additions
and
35 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,20 +21,6 @@ jobs: | |
uses: golangci/golangci-lint-action@v5 | ||
with: | ||
version: v1.56 | ||
lint-receptorctl: | ||
name: lint-receptorctl | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup nox | ||
uses: wntrblm/[email protected] | ||
|
||
- name: Run receptorctl linters | ||
run: make receptorctl-lint | ||
receptor: | ||
name: receptor (Go ${{ matrix.go-version }}) | ||
runs-on: ubuntu-latest | ||
|
@@ -100,29 +86,38 @@ jobs: | |
name: receptor | ||
path: /usr/local/bin/receptor | ||
receptorctl: | ||
name: receptorctl | ||
name: Run receptorctl tests${{ '' }} # Nest jobs under the same sidebar category | ||
needs: receptor | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Download receptor | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: receptor | ||
path: /usr/local/bin/ | ||
|
||
- name: Fix permissions on receptor binary | ||
run: sudo chmod a+x /usr/local/bin/receptor | ||
|
||
- name: Setup nox | ||
uses: wntrblm/[email protected] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: | ||
# NOTE: The highest and the lowest versions come | ||
# NOTE: first as their statuses are most likely to | ||
# NOTE: signal problems early: | ||
- 3.11 | ||
- 3.8 | ||
- >- | ||
3.10 | ||
- 3.9 | ||
uses: ./.github/workflows/reusable-nox.yml | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
session: tests-${{ matrix.python-version }} | ||
download-receptor: true | ||
|
||
- name: Run receptorctl tests | ||
run: make receptorctl-test | ||
lint-receptorctl: | ||
name: Lint receptorctl${{ '' }} # Nest jobs under the same sidebar category | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
session: | ||
- check_style | ||
- check_format | ||
uses: ./.github/workflows/reusable-nox.yml | ||
with: | ||
python-version: 3.11 | ||
session: ${{ matrix.session }} | ||
container: | ||
name: container | ||
runs-on: ubuntu-latest | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
name: Receptorctl nox sessions | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
python-version: | ||
type: string | ||
description: The Python version to use. | ||
required: true | ||
session: | ||
type: string | ||
description: The nox session to run. | ||
required: true | ||
download-receptor: | ||
type: boolean | ||
description: Whether to perform go binary download. | ||
required: false | ||
default: false | ||
|
||
env: | ||
FORCE_COLOR: 1 | ||
NOXSESSION: ${{ inputs.session }} | ||
|
||
jobs: | ||
nox: | ||
runs-on: ubuntu-latest | ||
|
||
name: >- # can't use `env` in this context: | ||
Run `receptorctl` ${{ inputs.session }} session | ||
steps: | ||
- name: Download the `receptor` binary | ||
if: fromJSON(inputs.download-receptor) | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: receptor | ||
path: /usr/local/bin/ | ||
|
||
- name: Set executable bit on the `receptor` binary | ||
if: fromJSON(inputs.download-receptor) | ||
run: sudo chmod a+x /usr/local/bin/receptor | ||
|
||
- name: Set up nox | ||
uses: wntrblm/[email protected] | ||
with: | ||
python-versions: ${{ inputs.python-version }} | ||
|
||
- name: Check out the source code from Git | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Needed for the automation in Nox to find the last tag | ||
sparse-checkout: receptorctl | ||
|
||
- name: Provision nox environment for ${{ env.NOXSESSION }} | ||
run: nox --install-only | ||
working-directory: ./receptorctl | ||
|
||
- name: Run `receptorctl` nox ${{ env.NOXSESSION }} session | ||
run: nox --no-install | ||
working-directory: ./receptorctl |
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