From fde42f5fe2d0992d1b5b0a030503797c9049a13d Mon Sep 17 00:00:00 2001 From: guillemdb Date: Tue, 17 Oct 2023 11:38:32 +0200 Subject: [PATCH] Update CI to newest action versions Signed-off-by: guillemdb --- .github/workflows/push.yml | 75 +++++++++++++++++++++++++++----------- 1 file changed, 54 insertions(+), 21 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 0ccb2cf..07d84ea 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -20,17 +20,23 @@ env: DOCKER_ORG: fragiletech DOCKER_USERNAME: ${{ secrets.DOCKERHUB_LOGIN }} DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PASS }} + PIP_CACHE: | + ~/.cache/pip + ~/.local/bin + ~/.local/lib/python3.*/site-packages jobs: Style-check: if: "!contains(github.event.head_commit.message, 'Bump version')" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 with: python-version: "3.10" + cache: 'pip' + cache-dependency-path: '**/requirements-lint.txt' - name: Install lint dependencies run: | python -m pip install --upgrade pip @@ -46,11 +52,23 @@ jobs: matrix: python-version: ['3.10'] steps: - - uses: actions/checkout@v2 + - name: actions/checkout + uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + cache: 'pip' + cache-dependency-path: | + **/setup.cfg + **/requirements.txt + **/requirements-test.txt + - name: actions/cache + uses: actions/cache@v3 + with: + path: ${{ env.PIP_CACHE }} + key: ubuntu-20.04-pip-test-${{ matrix.python-version }}-${{ hashFiles('requirements.txt', 'requirements-test.txt') }} + restore-keys: ubuntu-20.04-pip-test- - name: Install test and package dependencies run: | python -m pip install --upgrade pip @@ -66,16 +84,21 @@ jobs: Build-pypi: needs: Style-check - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: | git fetch --prune --unshallow - - name: Set up Python 3.8 - uses: actions/setup-python@v2 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: "3.10" + cache: 'pip' + cache-dependency-path: | + **/setup.cfg + **/requirements.txt + **/requirements-test.txt - name: Install dependencies run: | @@ -109,13 +132,18 @@ jobs: Test-pypi: if: "'$TEST_PYPI_PASS' != ''" needs: Build-pypi - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: "3.10" + cache: 'pip' + cache-dependency-path: | + **/setup.cfg + **/requirements.txt + **/requirements-test.txt - name: Install dependencies run: | @@ -141,7 +169,7 @@ jobs: fetch-depth: 100 persist-credentials: false - - name: Setup Python + - name: Setup Python 3.8 uses: actions/setup-python@v2 with: python-version: '3.8' @@ -165,15 +193,20 @@ jobs: Release-package: if: "contains(github.event.head_commit.message, 'Bump version') && github.ref == 'refs/heads/main' && '$PYPI_PASS' != ''" - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: | git fetch --prune --unshallow - - name: Set up Python 3.8 - uses: actions/setup-python@v2 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: "3.10" + cache: 'pip' + cache-dependency-path: | + **/setup.cfg + **/requirements.txt + **/requirements-test.txt - name: Install dependencies run: |