mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Improved CI configuration (#1613)
* add the `CI` environment variable; removes npm postinstall messages * move Node.js and Python versions to environment variables * add the Node.js and Python versions in cache filenames
This commit is contained in:
parent
314e88af6b
commit
513b9748ba
19
.github/workflows/ci.yml
vendored
19
.github/workflows/ci.yml
vendored
@ -23,6 +23,11 @@ on:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
env:
|
||||
CI: true
|
||||
NODE_VERSION: 10.x
|
||||
PYTHON_VERSION: 3.x
|
||||
|
||||
# Jobs to run
|
||||
jobs:
|
||||
|
||||
@ -37,13 +42,13 @@ jobs:
|
||||
# Install Node runtime and dependencies
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 10.x
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- uses: actions/cache@v1
|
||||
id: cache-node
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
|
||||
|
||||
- if: steps.cache-node.outputs.cache-hit != 'true'
|
||||
run: npm install
|
||||
@ -69,13 +74,13 @@ jobs:
|
||||
# Install Python runtime and dependencies
|
||||
- uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.x
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
|
||||
# - uses: actions/cache@v1
|
||||
# id: cache-python
|
||||
# with:
|
||||
# path: ~/.cache/pip
|
||||
# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
# key: ${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/requirements.txt') }}
|
||||
|
||||
# - if: steps.cache-python.outputs.cache-hit != 'true'
|
||||
- run: pip install -r requirements.txt
|
||||
@ -118,13 +123,13 @@ jobs:
|
||||
# Install Node runtime and dependencies
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 10.x
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- uses: actions/cache@v1
|
||||
id: cache-node
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
|
||||
|
||||
- if: steps.cache-node.outputs.cache-hit != 'true'
|
||||
run: npm install
|
||||
@ -135,7 +140,7 @@ jobs:
|
||||
# Install Python runtime and dependencies
|
||||
- uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.x
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
|
||||
- run: pip install --upgrade setuptools wheel twine
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user