mirror of https://github.com/tiangolo/fastapi.git
👷 Add GitHub Action cache to speed up CI installs (#3204)
This commit is contained in:
parent
c654e8384b
commit
d75126a4ce
|
|
@ -16,12 +16,19 @@ jobs:
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: "3.7"
|
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
|
- name: Install Flit
|
||||||
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: python3.7 -m pip install flit
|
run: python3.7 -m pip install flit
|
||||||
- name: Install docs extras
|
- name: Install docs extras
|
||||||
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: python3.7 -m flit install --extras doc
|
run: python3.7 -m flit install --extras doc
|
||||||
- name: Install Material for MkDocs Insiders
|
- 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
|
run: pip install git+https://${{ secrets.ACTIONS_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git
|
||||||
- name: Build Docs
|
- name: Build Docs
|
||||||
run: python3.7 ./scripts/docs.py build-all
|
run: python3.7 ./scripts/docs.py build-all
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,16 @@ jobs:
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: "3.6"
|
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
|
- name: Install Flit
|
||||||
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: pip install flit
|
run: pip install flit
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: flit install --symlink
|
run: flit install --symlink
|
||||||
- name: Publish
|
- name: Publish
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,16 @@ jobs:
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
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
|
- name: Install Flit
|
||||||
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: pip install flit
|
run: pip install flit
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: flit install --symlink
|
run: flit install --symlink
|
||||||
- name: Test
|
- name: Test
|
||||||
run: bash scripts/test.sh
|
run: bash scripts/test.sh
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue