From d3bc7707d53ca7d0633dec992ece0bf76f1cb4bc Mon Sep 17 00:00:00 2001 From: Steven Schlechte Date: Wed, 6 Nov 2024 15:47:18 +0100 Subject: [PATCH 1/4] add package path to nightly and release workflow --- .github/workflows/build-nightly.yml | 38 ++++++++++++++++++++--------- .github/workflows/build-release.yml | 38 ++++++++++++++++++++--------- .github/workflows/test.yml | 24 +++++++++--------- 3 files changed, 64 insertions(+), 36 deletions(-) diff --git a/.github/workflows/build-nightly.yml b/.github/workflows/build-nightly.yml index 5dc66cf0..2eaca2dd 100644 --- a/.github/workflows/build-nightly.yml +++ b/.github/workflows/build-nightly.yml @@ -11,15 +11,29 @@ on: jobs: test: uses: './.github/workflows/test.yml' - create_nightly: - needs: test - uses: "platomo/GitHub-workflows/.github/workflows/reusable-create-release-with-assets.yml@main" - secrets: - PLATOMO_BUILDER_ACCESS: ${{ secrets.PLATOMO_BUILDER_ACCESS }} - with: - package-path: OTVision - package-version: nightly - draft-release: false - pre-release: true - delete-existing: true - + create_nighty: + needs: + - test + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Update Version + uses: platomo/update-version-py-action@main + with: + version: nightly + file-path: OTVision + - name: Create Release + uses: platomo/build-release-asset-action@main + with: + platomo-token: ${{ secrets.PLATOMO_BUILDER_ACCESS }} + package-version: nightly + save-artifacts: true + - name: Publish Release + uses: platomo/publish-release-action@main + with: + package-version: nightly + delete-existing: true + pre-release: true + py-version: "3.11" + draft-release: false diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 135644b7..bca2db83 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -12,15 +12,29 @@ jobs: test: if: endsWith(github.event.base_ref, 'main') uses: './.github/workflows/test.yml' - create_release: - needs: test - uses: "platomo/GitHub-workflows/.github/workflows/reusable-create-release-with-assets.yml@main" - secrets: - PLATOMO_BUILDER_ACCESS: ${{ secrets.PLATOMO_BUILDER_ACCESS }} - with: - package-path: OTVision - package-version: ${{ github.ref_name }} - draft-release: false - pre-release: false - delete-existing: false - + create-release: + needs: + - test + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Update Version + uses: platomo/update-version-py-action@main + with: + version: ${{ github.ref_name }} + file-path: OTVision + - name: Create Release + uses: platomo/build-release-asset-action@main + with: + platomo-token: ${{ secrets.PLATOMO_BUILDER_ACCESS }} + package-version: ${{ github.ref_name }} + save-artifacts: true + - name: Publish Release + uses: platomo/publish-release-action@main + with: + package-version: ${{ github.ref_name }} + delete-existing: false + pre-release: false + py-version: "3.11" + draft-release: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 42f0b548..02ad9f95 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,15 +9,15 @@ on: jobs: test: - name: Run Python tests on multiple OS and Python versions - strategy: - fail-fast: True - matrix: - os: [ubuntu-latest, windows-latest] - py: ["3.11"] - uses: 'platomo/GitHub-workflows/.github/workflows/reusable-python-tests.yml@main' - with: - os: ${{ matrix.os }} - py-version: ${{ matrix.py }} - test_path: OTVision - ffmpeg-required: true + runs-on: [ubuntu-latest, windows-latest] + permissions: + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Run Python Tests + uses: platomo/test-python-app-action@main + with: + py-version: 3.11 + test_path: OTAnalytics + ffmpeg-required: true From 41a3f6772fac3564c5fc68385bede03b5916f39d Mon Sep 17 00:00:00 2001 From: Steven Schlechte Date: Wed, 6 Nov 2024 16:13:02 +0100 Subject: [PATCH 2/4] changed test runs on --- .github/workflows/test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 02ad9f95..f89f2b51 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,10 @@ on: jobs: test: - runs-on: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, windows-latest ] permissions: id-token: write steps: From d96a95fce78808214ad7333216d30f191cfd7bac Mon Sep 17 00:00:00 2001 From: Sebastian Buck <38660441+frunika@users.noreply.github.com> Date: Fri, 3 Jan 2025 13:20:28 +0100 Subject: [PATCH 3/4] Update GitHub Actions workflow for Python test matrix Updated the test workflow to specify a matrix for both OS and Python versions, added a fail-fast strategy, and renamed steps for clarity. Upgraded dependencies to newer versions and adjusted paths to align with recent project structure changes. --- .github/workflows/test.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f89f2b51..5d0acc75 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,18 +9,21 @@ on: jobs: test: - runs-on: ${{ matrix.os }} + name: Execute tests across various operating systems and Python versions. strategy: - matrix: - os: [ ubuntu-latest, windows-latest ] - permissions: - id-token: write + matrix: + os: [ubuntu-latest, windows-latest] + py: ["3.11"] + fail-fast: true + runs-on: ${{ matrix.os }} steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Run Python Tests - uses: platomo/test-python-app-action@main + uses: platomo/test-python-app-action@v1 + timeout-minutes: 60 with: - py-version: 3.11 - test_path: OTAnalytics + py-version: ${{ matrix.py }} + package-path: OTVision + test-path: tests ffmpeg-required: true From 0875f8187c584a317f0d12e64eb1fa0e2187dcba Mon Sep 17 00:00:00 2001 From: Sebastian Buck <38660441+frunika@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:17:16 +0100 Subject: [PATCH 4/4] Set read-all permissions in GitHub Actions workflow Added `permissions: read-all` to the workflow to align with GitHub's least privilege principle. This ensures the workflow operates with minimal required permissions, enhancing security. --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5d0acc75..8a5a9886 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,6 +7,8 @@ on: pull_request: workflow_call: +permissions: read-all + jobs: test: name: Execute tests across various operating systems and Python versions.