-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
119 additions
and
28 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Poetry Install | ||
description: Installs Python dependencies using Poetry | ||
|
||
inputs: | ||
poetry-version: | ||
description: The version of Poetry to install | ||
type: string | ||
required: true | ||
python-version: | ||
description: The version of Python to use | ||
type: string | ||
required: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install Poetry | ||
shell: bash | ||
run: | | ||
pipx install poetry==${{ inputs.poetry-version}} | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
cache: 'poetry' | ||
cache-dependency-path: poetry.lock | ||
|
||
- name: Set Poetry environment | ||
shell: bash | ||
run: | | ||
poetry env use ${{ inputs.python-version }} | ||
- name: Install project dependencies | ||
shell: bash | ||
run: | | ||
poetry install --no-interaction --no-root |
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,34 @@ | ||
# Reusable workflow consumed by ci.yml; used to share a single matrix across jobs. | ||
on: | ||
workflow_call: | ||
inputs: | ||
runner: | ||
required: true | ||
type: string | ||
python-version: | ||
required: true | ||
type: string | ||
poetry-version: | ||
required: true | ||
type: string | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
tests: | ||
name: Run tests (Python ${{ matrix.python-version }}), Poetry ${{ matrix.poetry-version }}, Platform ${{ matrix.runner }}) | ||
runs-on: ${{ inputs.runner }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/poetry-install | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
poetry-version: ${{ inputs.poetry-version }} | ||
|
||
- name: Run unit tests | ||
run: | | ||
poetry run pytest spotify_sync/tests |
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 |
---|---|---|
@@ -1,42 +1,58 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: [main] | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
build-and-test: | ||
name: Build and test | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10', '3.11', '3.11'] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Poetry | ||
run: | | ||
pipx install poetry==1.8.4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
- uses: ./.github/actions/poetry-install | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'poetry' | ||
cache-dependency-path: poetry.lock | ||
|
||
- name: Set Poetry environment | ||
run: | | ||
poetry env use ${{ matrix.python-version }} | ||
- name: Install project dependencies | ||
run: | | ||
poetry install --no-interaction --no-root | ||
python-version: '3.12' | ||
poetry-version: '1.8.4' | ||
|
||
- name: Code Quality | ||
run: poetry run black . --check | ||
|
||
- name: Unit Tests | ||
run: poetry run pytest spotify_sync/tests | ||
run: | | ||
poetry install black | ||
poetry run black . --check | ||
unit-tests: | ||
name: "Unit tests (Python ${{ matrix.python-version }}, Poetry ${{ matrix.poetry-version }}, Platform ${{ matrix.os.name }})" | ||
uses: ./.github/workflows/_tests-matrix.yml | ||
needs: lint | ||
with: | ||
runner: ${{ matrix.os.image }} | ||
python-version: ${{ matrix.python-version }} | ||
poetry-version: '1.8.4' | ||
strategy: | ||
matrix: | ||
os: | ||
- name: Ubuntu | ||
image: ubuntu-22.04 | ||
- name: macOS x86_64 | ||
image: macos-13 | ||
- name: Windows | ||
image: windows-2022 | ||
- name: macOS aarch64 | ||
image: macos-14 | ||
python-version: | ||
- '3.8' | ||
- '3.9' | ||
- '3.10' | ||
- '3.11' | ||
- '3.11' | ||
- '3.12' | ||
fail-fast: false |