From 880cc49136aef1208413e5e0c843702003dfab53 Mon Sep 17 00:00:00 2001 From: Matthew Hambley Date: Tue, 11 Mar 2025 09:35:01 +0000 Subject: [PATCH 1/2] Migrate to new caching API. --- .github/workflows/sphinx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml index 50399d7..76a73b0 100644 --- a/.github/workflows/sphinx.yml +++ b/.github/workflows/sphinx.yml @@ -41,7 +41,7 @@ jobs: python-version: 3.11 - name: Cache pip - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} From ba7be03914843f826a99efe44c57346680f0d4f8 Mon Sep 17 00:00:00 2001 From: Matthew Hambley Date: Tue, 11 Mar 2025 10:05:17 +0000 Subject: [PATCH 2/2] Updated all workflows. --- .github/workflows/performance.yml | 2 +- .github/workflows/publish.yml | 13 +++++++++++++ .github/workflows/pullrequest.yml | 14 ++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index f7de294..4586fdd 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -32,7 +32,7 @@ jobs: python-version: 3.7 - name: Cache pip - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index be98117..63de6ba 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,18 +11,31 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Set up Python environment uses: actions/setup-python@v4 with: python-version: "3.7" + + - name: Cache pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + - name: Prepare environment run: | python3 -m pip install --upgrade pip pip install -e .[release] + - name: Create packages run: | python3 setup.py sdist python3 setup.py bdist_wheel + - name: Publish packages run: | python3 -m twine dist/* diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 15ac103..a1af4c4 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -21,22 +21,36 @@ 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: Cache pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + - name: Prepare environment run: | python3 -m pip install --upgrade pip pip install -e . + - name: Lint with flake8 run: | pip install -e .[dev] flake8 . --count --show-source --statistics + - name: Check with MyPy run: | pip install -e .[test] mypy source unit-tests system-tests + - name: Test with pytest run: | pip install .[test]