From 1659c50df8037f3c19719782e4a5b8dacde1c244 Mon Sep 17 00:00:00 2001 From: phschiele Date: Mon, 13 May 2024 07:12:10 -0700 Subject: [PATCH 1/3] Modify build action --- .github/workflows/build.yml | 49 ++++++++++++++++++++++++++++++++ .github/workflows/unit_tests.yml | 32 --------------------- 2 files changed, 49 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/unit_tests.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..729feea --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,49 @@ +name: Testing + +on: + pull_request: + push: + branches: + - main + tags: + - '*' + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.9" + - uses: pre-commit/action@v3.0.1 + + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: | + 3.12 + 3.11 + 3.10 + 3.9 + 3.8 + - run: pipx install hatch + - run: hatch env create + - run: hatch run test + + - name: build + # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + run: | + pip install --upgrade build + python -m build + + - name: publish + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml deleted file mode 100644 index 1d54272..0000000 --- a/.github/workflows/unit_tests.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Testing - -on: - push: - branches: [ main ] - pull_request: - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - lint: - name: Lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.9" - - uses: pre-commit/action@v3.0.1 - - test: - name: Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.9" - - run: pipx install hatch - - run: hatch env create - - run: hatch run test From b085320c934e1345435de8ea71a8776b04e53220 Mon Sep 17 00:00:00 2001 From: phschiele Date: Mon, 13 May 2024 07:14:03 -0700 Subject: [PATCH 2/3] Rename workflow --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 729feea..969a74d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Testing +name: Build on: pull_request: From 860330b9c9f10172c18ac425055cbea037dd9e04 Mon Sep 17 00:00:00 2001 From: fabian-sp Date: Wed, 15 May 2024 17:22:41 +0200 Subject: [PATCH 3/3] comment out --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 969a74d..c7dea32 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: - run: hatch run test - name: build - # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') run: | pip install --upgrade build python -m build