From d88b0f562945a7012d732cbeedb91b02f7f2066c Mon Sep 17 00:00:00 2001 From: idiap Date: Mon, 23 Dec 2024 15:54:07 +0100 Subject: [PATCH] build: reuse github workflow from cbi_toolbox --- .github/workflows/python-release.yml | 34 ++++++++++++++++++++++++++++ .github/workflows/python-testing.yml | 32 ++++++++++++++++++++++++++ .github/workflows/test.yml | 15 ------------ 3 files changed, 66 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/python-release.yml create mode 100644 .github/workflows/python-testing.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/python-release.yml b/.github/workflows/python-release.yml new file mode 100644 index 0000000..048b17a --- /dev/null +++ b/.github/workflows/python-release.yml @@ -0,0 +1,34 @@ +# SPDX-FileCopyrightText: 2024 Idiap Research Institute +# +# SPDX-License-Identifier: BSD-3-Clause + +name: Make Release + +on: + push: + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - name: Wait for build to succeed + uses: fountainhead/action-wait-for-check@v1.0.0 + id: wait-for-build + with: + token: ${{ secrets.GITHUB_TOKEN }} + checkName: build + - name: Check test results + if: steps.wait-for-build.outputs.conclusion == 'failure' + run: | + exit 1 + - name: Create Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} diff --git a/.github/workflows/python-testing.yml b/.github/workflows/python-testing.yml new file mode 100644 index 0000000..d8abe95 --- /dev/null +++ b/.github/workflows/python-testing.yml @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: 2024 Idiap Research Institute +# +# SPDX-License-Identifier: BSD-3-Clause + +name: Test Python Package + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + submodules: 'recursive' + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.9' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install . + - name: Unittests + run: | + python -m unittest discover tests diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 8d25832..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,15 +0,0 @@ -jobs: - quality: - runs-on: ubuntu-latest - name: qa - steps: - - run: - - pip install pre-commit - - pre-commit run --all-files - - build-job: - runs-on: ubuntu-latest - name: build - steps: - - run: - - pip install . --no-cache \ No newline at end of file