Adding node/pip caching to ci - fix passing HAS_SECRET to build_windows (#291)

* spell HAVE_SECRET right - remove extra Azure Pipelines env var
* Remove debug - cache pip
* Add caching to macos and ubuntu
* Key cache on setup.py - use pip to get cache dir
* Remove macos, ubuntu "os" updates
This commit is contained in:
Gene Hoffman 2020-06-15 18:28:24 -07:00
parent dbde81f971
commit 2c00603441
5 changed files with 80 additions and 20 deletions

View File

@ -27,6 +27,32 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Test for secrets access
id: check_secrets
shell: bash
@ -44,9 +70,9 @@ jobs:
p12-file-base64: ${{ secrets.APPLE_DEV_ID_APP }}
p12-password: ${{ secrets.APPLE_DEV_ID_APP_PASS }}
- name: Install MacOS dependencies
run: |
brew update
# - name: Install MacOS dependencies
# run: |
# brew update
- name: Run install script
env:

View File

@ -27,9 +27,34 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install ubuntu dependencies
run: |
sudo apt-get update
sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y
sudo apt-get install nodejs-dev node-gyp

View File

@ -19,17 +19,30 @@ jobs:
# we need fetch-depth 0 so setuptools_scm can resolve tags
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Test for secrets access
id: check_secrets

View File

@ -95,7 +95,6 @@ steps:
sh build_macos.sh
ls -l final_installer
displayName: "Build DMG with build_scripts/build_macos.sh"
env: { CHIA_INSTALLER_VERSION: "0.1.6" }
- task: PublishPipelineArtifact@1
inputs:

View File

@ -94,10 +94,7 @@ Write-Output "node winstaller.js"
node winstaller.js
Write-Output " ---"
Write-Output "HAS SECRET is:"
Get-Childitem env:HAS_SECRET
If ($env:HAS_SECRETS -eq "true") {
If ($env:HAS_SECRET) {
Write-Output " ---"
Write-Output "Add timestamp and verify signature"
Write-Output " ---"