Skip to content

Commit

Permalink
Merge pull request #605 from doorstop-dev/pyyaml-6
Browse files Browse the repository at this point in the history
Upgrade PyYAML to fix installation on newer Python versions
  • Loading branch information
jacebrowning authored Oct 7, 2023
2 parents ca11cdd + 6875573 commit 07ef4d2
Show file tree
Hide file tree
Showing 9 changed files with 713 additions and 651 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/execute-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Execute tests
on:
workflow_call:
inputs:
basepath:
required: false
type: string
os:
required: true
type: string
workpath:
required: true
type: string

jobs:
test:
runs-on: ${{ inputs.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
name: Python ${{ matrix.python-version }}

defaults:
run:
working-directory: ${{ inputs.workpath }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Change path on Windows
if: ${{ inputs.os == 'windows-latest' }}
# Cannot start powershell from a path that does not exist, so change
# working directory for this step only.
working-directory: ${{ inputs.basepath }}
run: |
mkdir -p ${{ inputs.workpath }}
mv $env:GITHUB_WORKSPACE\* ${{ inputs.workpath }}\ -Force
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- uses: Gr1N/setup-poetry@v8

- name: Check system dependencies
run: make doctor

- uses: actions/cache@v2
with:
path: .venv
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}

- name: Install project dependencies
run: make install

# Some tests fails intermittently, likely due to the public runners being
# very slow. Especially any client/server tests seems to be problematic.
# This is a simple attempt to re-run the tests up to three times if they
# fail. Does not add any execution time if successful.
- name: Run tests attempt 1
run: make test
- name: Run tests attempt 2
if: ${{ failure() }}
run: make test
- name: Run tests attempt 3
if: ${{ failure() }}
run: make test

- name: Upload coverage
uses: codecov/codecov-action@v1
if: ${{ inputs.os == 'ubuntu-latest' && matrix.python-version == '3.9' && github.repository == 'doorstop-dev/doorstop' }}
with:
fail_ci_if_error: true

- name: Run checks
run: make check
if: ${{ inputs.os == 'ubuntu-latest' }}

- name: Run demo
run: make demo
if: ${{ inputs.os == 'ubuntu-latest' }}
13 changes: 13 additions & 0 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Linux

on:
push:
pull_request:
branches: [ develop ]

jobs:
Test:
uses: ./.github/workflows/execute-tests.yml
with:
os: "ubuntu-latest"
workpath: "/home/runner/work/doorstop/doorstop"
13 changes: 13 additions & 0 deletions .github/workflows/test-osx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: macOS

on:
push:
pull_request:
branches: [ develop ]

jobs:
Test:
uses: ./.github/workflows/execute-tests.yml
with:
os: "macos-latest"
workpath: "/Users/runner/work/doorstop/doorstop"
14 changes: 14 additions & 0 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Windows

on:
push:
pull_request:
branches: [ develop ]

jobs:
Test:
uses: ./.github/workflows/execute-tests.yml
with:
basepath: 'D:\'
os: "windows-latest"
workpath: 'C:\a\doorstop\doorstop'
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
python 3.8.13
poetry 1.6.1
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.2.1 (2023-10-07)

- Upgrade PyYAML to 6.x to fix installation on newer versions of Python.

# 2.2 (2022-01-22)

- Added support for UTF-8 symbols in references. ([@stanislaw](https://github.com/doorstop-dev/doorstop/pull/485))
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ DEPENDENCIES := $(VIRTUAL_ENV)/.poetry-$(shell bin/checksum pyproject.toml poetr
install: $(DEPENDENCIES) .cache

$(DEPENDENCIES): poetry.lock
@ rm -rf ~/Library/Preferences/pypoetry
@ poetry config virtualenvs.in-project true
poetry install
@ touch $@
Expand Down
Loading

0 comments on commit 07ef4d2

Please sign in to comment.