From e120779f4f8d5b7241658040850bafac7cafa76f Mon Sep 17 00:00:00 2001 From: Zaharia Constantin <1303303+soulraven@users.noreply.github.com> Date: Mon, 10 Jun 2024 12:03:32 +0300 Subject: [PATCH] Change the version of ci/cd actions --- .github/workflows/publish_to_pypi.yml | 40 +++++++++++++++++++++++ .github/workflows/push_to_main.yml | 4 +-- .github/workflows/setup-poetry/action.yml | 6 ++-- 3 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/publish_to_pypi.yml diff --git a/.github/workflows/publish_to_pypi.yml b/.github/workflows/publish_to_pypi.yml new file mode 100644 index 0000000..d4432df --- /dev/null +++ b/.github/workflows/publish_to_pypi.yml @@ -0,0 +1,40 @@ +name: >- + Publish Python 🐍 distribution 📦 to PyPI and TestPyPI +on: + release: + types: [ published ] + branches: [ main ] +jobs: + quality: + runs-on: ubuntu-latest + steps: + + - name: Check out + uses: actions/checkout@v4 + + - name: Set up the environment + uses: ./.github/workflows/setup-poetry + + - name: Run checks + uses: ./.github/workflows/checks + + tox: + runs-on: ubuntu-latest + needs: quality + strategy: + matrix: + python-version: [ '3.10' ] + steps: + - name: Check out + uses: actions/checkout@v4 + + - name: Set up the environment + uses: ./.github/workflows/setup-poetry + with: + python-version: ${{ matrix.python-version }} + + - name: Test with tox + run: | + source .venv/bin/activate + poetry add tox-gh-actions + tox diff --git a/.github/workflows/push_to_main.yml b/.github/workflows/push_to_main.yml index 396ed17..0687064 100644 --- a/.github/workflows/push_to_main.yml +++ b/.github/workflows/push_to_main.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Check out - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up the environment uses: ./.github/workflows/setup-poetry @@ -28,7 +28,7 @@ jobs: steps: - name: Check out - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up the environment uses: ./.github/workflows/setup-poetry diff --git a/.github/workflows/setup-poetry/action.yml b/.github/workflows/setup-poetry/action.yml index 1e46f66..fc0a3a1 100644 --- a/.github/workflows/setup-poetry/action.yml +++ b/.github/workflows/setup-poetry/action.yml @@ -13,9 +13,9 @@ runs: # check-out repo and set-up python #---------------------------------------------- - name: Check out repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ inputs.python-version }} #---------------------------------------------- @@ -33,7 +33,7 @@ runs: #---------------------------------------------- - name: Load cached venv id: cached-poetry-dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: .venv key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}