diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 72e2da1070c4b..ad20f45b48437 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -16,12 +16,19 @@ jobs: uses: actions/setup-python@v2 with: python-version: "3.7" + - uses: actions/cache@v2 + id: cache + with: + path: ${{ env.pythonLocation }} + key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-docs - name: Install Flit + if: steps.cache.outputs.cache-hit != 'true' run: python3.7 -m pip install flit - name: Install docs extras + if: steps.cache.outputs.cache-hit != 'true' run: python3.7 -m flit install --extras doc - name: Install Material for MkDocs Insiders - if: github.event.pull_request.head.repo.fork == false + if: github.event.pull_request.head.repo.fork == false && steps.cache.outputs.cache-hit != 'true' run: pip install git+https://${{ secrets.ACTIONS_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git - name: Build Docs run: python3.7 ./scripts/docs.py build-all diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 43f086e53781e..9dde4e066c59f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,9 +18,16 @@ jobs: uses: actions/setup-python@v2 with: python-version: "3.6" + - uses: actions/cache@v2 + id: cache + with: + path: ${{ env.pythonLocation }} + key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-publish - name: Install Flit + if: steps.cache.outputs.cache-hit != 'true' run: pip install flit - name: Install Dependencies + if: steps.cache.outputs.cache-hit != 'true' run: flit install --symlink - name: Publish env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 88fa290d541c3..f346cab6be363 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,9 +19,16 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - uses: actions/cache@v2 + id: cache + with: + path: ${{ env.pythonLocation }} + key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-test - name: Install Flit + if: steps.cache.outputs.cache-hit != 'true' run: pip install flit - name: Install Dependencies + if: steps.cache.outputs.cache-hit != 'true' run: flit install --symlink - name: Test run: bash scripts/test.sh