From 172681f5fce4958450a6ab2103bdeee89d9f7d9c Mon Sep 17 00:00:00 2001 From: Roman Paska Date: Tue, 16 Nov 2021 11:14:03 +0200 Subject: [PATCH 1/2] #256 Improve caching of Python dependencies --- .github/workflows/Integrate.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Integrate.yml b/.github/workflows/Integrate.yml index f9e00a5..7bb8fa3 100644 --- a/.github/workflows/Integrate.yml +++ b/.github/workflows/Integrate.yml @@ -129,11 +129,22 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Get PiP Cache Directory + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + - name: Cache PiP dependencies + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ runner.os }}-pip + + - name: Cache Python environment uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-${{ matrix.molecule-platform }} + key: ${{ env.pythonLocation }} - name: Install Molecule and it's dependencies run: pip install --upgrade --upgrade-strategy eager ansible==4.* ansible-lint yamllint molecule python-vagrant molecule-vagrant From b9cc5865f8aa633b529929a89458f5ae4f5a4c64 Mon Sep 17 00:00:00 2001 From: Roman Paska Date: Tue, 16 Nov 2021 12:01:51 +0200 Subject: [PATCH 2/2] #256 Move PiP requirements to a separate file --- .github/workflows/Integrate.yml | 6 +++--- molecule/requirements.txt | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 molecule/requirements.txt diff --git a/.github/workflows/Integrate.yml b/.github/workflows/Integrate.yml index 7bb8fa3..cfc93e8 100644 --- a/.github/workflows/Integrate.yml +++ b/.github/workflows/Integrate.yml @@ -138,16 +138,16 @@ jobs: uses: actions/cache@v2 with: path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip + key: ${{ runner.os }}-pip-${{ hashFiles('./molecule/requirements.txt') }} - name: Cache Python environment uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }} + key: ${{ env.pythonLocation }}-${{ hashFiles('./molecule/requirements.txt') }} - name: Install Molecule and it's dependencies - run: pip install --upgrade --upgrade-strategy eager ansible==4.* ansible-lint yamllint molecule python-vagrant molecule-vagrant + run: pip install --upgrade --upgrade-strategy eager --requirement ./molecule/requirements.txt - name: Run Molecule tests run: molecule test diff --git a/molecule/requirements.txt b/molecule/requirements.txt new file mode 100644 index 0000000..735f55f --- /dev/null +++ b/molecule/requirements.txt @@ -0,0 +1,6 @@ +ansible==4.* +ansible-lint +yamllint +molecule +python-vagrant +molecule-vagrant