From 7da976d7a3713d3170e2cb2bc8b9bbeaacc9a225 Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Wed, 1 Jul 2026 13:55:33 +0100 Subject: [PATCH 1/3] Generate API docs for OpenFlexure This should be helpful when figuring out if we've changed the Thing Description. --- .github/workflows/test.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a417b10..56502b57 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -238,6 +238,21 @@ jobs: - name: Run OFM lifecycle test run: tests/lifecycle_test/testfile.py + - name: Generate OpenAPI and Thing Description. + run: | + mkdir -p ./apidocs/http/ + python ./generate_http_api_data.py + ls ./apidocs/http/ + + - name: Upload OpenAPI and Thing Description + uses: actions/upload-artifact@v7 + with: + name: api_docs + path: | + ../openflexure-microscope-server/apidocs/http/openapi.json + ../openflexure-microscope-server/apidocs/http/thing_description.json + if-no-files-found: error + - name: Type check with `mypy` run: mypy src From c50eebac1be1cc48fc0addcd3a2f3ee20ae23ee4 Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Thu, 2 Jul 2026 13:37:22 +0100 Subject: [PATCH 2/3] Move files so they're found by `upload` job. The upload step ignores the working directory, so I've moved the files back into the original repo. --- .github/workflows/test.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 56502b57..df5c2cd1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -239,18 +239,20 @@ jobs: run: tests/lifecycle_test/testfile.py - name: Generate OpenAPI and Thing Description. + # Note: we need to move the files into the original + # repo directory, so they're found by the next step. run: | mkdir -p ./apidocs/http/ python ./generate_http_api_data.py - ls ./apidocs/http/ + mv apidocs ../labthings-fastapi - name: Upload OpenAPI and Thing Description uses: actions/upload-artifact@v7 with: name: api_docs - path: | - ../openflexure-microscope-server/apidocs/http/openapi.json - ../openflexure-microscope-server/apidocs/http/thing_description.json + path: | # Note: this ignores working-directory + apidocs/http/openapi.json + apidocs/http/thing_description.json if-no-files-found: error - name: Type check with `mypy` From ac2059d9790ca68528e62722ffcead04a0ef0695 Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Thu, 2 Jul 2026 14:24:17 +0100 Subject: [PATCH 3/3] Update action versions This should get around node deprecation. --- .github/workflows/test.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index df5c2cd1..efe4ae5b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,12 +8,12 @@ jobs: continue-on-error: true runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v7 with: ref: ${{ github.base_ref }} - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v6 with: python-version: 3.12 @@ -26,7 +26,7 @@ jobs: mv coverage.lcov base-coverage.lcov - name: Upload code coverage for base branch - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: base-coverage.lcov path: ./base-coverage.lcov @@ -34,7 +34,7 @@ jobs: pip_audit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: pypa/gh-action-pip-audit@v1.1.0 with: @@ -47,10 +47,10 @@ jobs: python: ["3.10", "3.11", "3.12", "3.13"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v7 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python }} @@ -80,7 +80,7 @@ jobs: run: pytest - name: Upload code coverage - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: coverage-${{ matrix.python }} path: | @@ -97,10 +97,10 @@ jobs: python: ["3.10", "3.11", "3.12", "3.13"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v7 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python }} @@ -134,7 +134,7 @@ jobs: needs: [base_coverage, test] steps: - name: Download code coverage report - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: coverage-3.12 @@ -161,7 +161,7 @@ jobs: - name: Download code coverage report for base branch id: download-base-coverage continue-on-error: true - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: base-coverage.lcov @@ -198,9 +198,9 @@ jobs: env: REF: v3 steps: &test-against-ofm-steps - - uses: actions/checkout@v3 + - uses: actions/checkout@v7 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v6 with: python-version: '3.11' @@ -252,7 +252,7 @@ jobs: name: api_docs path: | # Note: this ignores working-directory apidocs/http/openapi.json - apidocs/http/thing_description.json + apidocs/http/thing_descriptions.json if-no-files-found: error - name: Type check with `mypy`