From 778a541b5ee441c6e32faa4b89714b8af27380a2 Mon Sep 17 00:00:00 2001 From: PascalEgn Date: Tue, 17 Sep 2024 13:57:44 +0200 Subject: [PATCH] gh-actions: refactor --- .../install-python-dependencies/action.yml | 15 -------- .github/workflows/build-and-release.yml | 38 +++++++------------ 2 files changed, 14 insertions(+), 39 deletions(-) delete mode 100644 .github/actions/install-python-dependencies/action.yml diff --git a/.github/actions/install-python-dependencies/action.yml b/.github/actions/install-python-dependencies/action.yml deleted file mode 100644 index 4b1de9b..0000000 --- a/.github/actions/install-python-dependencies/action.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Install python dependencies -description: Setup python packages and requirements - -runs: - using: composite - steps: - - name: Setup python additional packages - shell: bash - run: | - python -m pip install --upgrade pip - pip install setuptools wheel py coveralls - - - name: Install requirements - shell: bash - run: pip install -e .[tests] \ No newline at end of file diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 8cf53a6..7599494 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -11,7 +11,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [2.7, 3.6] + include: + - python: python3.6 + pip: pip3 + - python: python2 + pip: pip steps: - name: Checkout @@ -19,23 +23,16 @@ jobs: with: fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache Python - uses: actions/cache@v2.1.3 - id: cache - with: - path: ${{ env.pythonLocation }} - key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ github.sha }} - - name: Install python dependencies - uses: ./.github/actions/install-python-dependencies + run: | + ${{ matrix.pip }} install --user --upgrade pip + ${{ matrix.pip }} --no-cache-dir install --user setuptools wheel py coveralls + ${{ matrix.pip }} --no-cache-dir install --user -e .[tests] - name: Show python dependencies - run: pip freeze + run: | + ${{ matrix.python }} --version + ${{ matrix.pip }} freeze - name: Run tests uses: ./.github/actions/run-tests @@ -67,17 +64,10 @@ jobs: with: fetch-depth: 0 - - name: Set up Python 2.7 + - name: Set up Python 3.x uses: actions/setup-python@v2 with: - python-version: 2.7 - - - name: Cache Python Dependencies - uses: actions/cache@v2.1.3 - id: cache - with: - path: ${{ env.pythonLocation }} - key: ${{ runner.os }}-pip-2.7-${{ github.sha }} + python-version: 3.x - name: Install python dependencies uses: ./.github/actions/install-python-dependencies