Moved the cache actions to the top of the file

This commit is contained in:
evandrocoan 2020-03-23 14:13:27 -03:00
parent 8e43016248
commit 19dab43aae
3 changed files with 64 additions and 66 deletions

View file

@ -7,26 +7,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Set up protoc
uses: Arduino/actions/setup-protoc@master
- name: Set up node
uses: actions/setup-node@v1
with:
node-version: 12
- name: Set up ripgrep, pyaudio, gettext, rename
run: |
sudo apt update
sudo apt install portaudio19-dev gettext rename
sudo snap install ripgrep --classic
- name: Cache pyenv
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/pyenv
key: ${{ runner.os }}-pyenv-${{ hashFiles('**/Makefile') }}-${{ hashFiles('**/requirements.txt') }}-
# Necessary for now for the cargo cache: # Necessary for now for the cargo cache:
# https://github.com/actions/cache/issues/133#issuecomment-599102035 # https://github.com/actions/cache/issues/133#issuecomment-599102035
- name: Fix ~/.cache permissions - name: Fix ~/.cache permissions
@ -52,6 +32,26 @@ jobs:
with: with:
path: ~/.cache/pip path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
- name: Cache pyenv
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/pyenv
key: ${{ runner.os }}-pyenv-${{ hashFiles('**/Makefile') }}-${{ hashFiles('**/requirements.txt') }}-
- name: Set up python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Set up protoc
uses: Arduino/actions/setup-protoc@master
- name: Set up node
uses: actions/setup-node@v1
with:
node-version: 12
- name: Set up ripgrep, pyaudio, gettext, rename
run: |
sudo apt update
sudo apt install portaudio19-dev gettext rename
sudo snap install ripgrep --classic
- name: Run checks - name: Run checks
run: | run: |
export RSPY_TARGET_DIR=~/target export RSPY_TARGET_DIR=~/target
@ -65,5 +65,5 @@ jobs:
- name: Upload python wheels - name: Upload python wheels
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
with: with:
name: Linux python wheels name: linux_python_wheels
path: dist path: dist

View file

@ -9,26 +9,6 @@ jobs:
runs-on: macOS-latest runs-on: macOS-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Set up protoc
uses: Arduino/actions/setup-protoc@master
- name: Set up node
uses: actions/setup-node@v1
with:
node-version: 12
- name: Set up brew packages
run: |
brew install portaudio protobuf gettext rename ripgrep
brew link gettext --force
- name: Cache pyenv
id: cache-pyenv
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/pyenv
key: ${{ runner.os }}-pyenv-${{ hashFiles('**/Makefile') }}-${{ hashFiles('**/requirements.txt') }}-
- name: Cache cargo registry - name: Cache cargo registry
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
@ -49,6 +29,25 @@ jobs:
with: with:
path: ~/Library/Caches/pip path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
- name: Cache pyenv
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/pyenv
key: ${{ runner.os }}-pyenv-${{ hashFiles('**/Makefile') }}-${{ hashFiles('**/requirements.txt') }}-
- name: Set up python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Set up protoc
uses: Arduino/actions/setup-protoc@master
- name: Set up node
uses: actions/setup-node@v1
with:
node-version: 12
- name: Set up brew packages
run: |
brew install portaudio protobuf gettext rename ripgrep
brew link gettext --force
- name: Run checks - name: Run checks
run: | run: |
export RSPY_TARGET_DIR=~/target export RSPY_TARGET_DIR=~/target
@ -62,5 +61,5 @@ jobs:
- name: Upload python wheels - name: Upload python wheels
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
with: with:
name: Mac OS python wheels name: mac_os_python_wheels
path: dist path: dist

View file

@ -23,14 +23,33 @@ jobs:
echo "::set-env name=SCOOP_GLOBAL::$env:GITHUB_WORKSPACE\" echo "::set-env name=SCOOP_GLOBAL::$env:GITHUB_WORKSPACE\"
echo "::set-env name=ANKI_EXTRA_PIP::python -m pip install $pyaudio" echo "::set-env name=ANKI_EXTRA_PIP::python -m pip install $pyaudio"
- name: Cache pyenv - name: Cache pyenv
id: cache-pyenv
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ${{ github.workspace }}\pyenv path: ${{ github.workspace }}\pyenv
key: ${{ runner.os }}-pyenv-${{ hashFiles('**/Makefile') }}-${{ hashFiles('**/requirements.txt') }}- key: ${{ runner.os }}-pyenv-${{ hashFiles('**/Makefile') }}-${{ hashFiles('**/requirements.txt') }}-
- name: Cache pacman - name: Cache cargo registry
id: cache-pacman
uses: actions/cache@v1 uses: actions/cache@v1
with:
path: C:\Rust\.cargo\registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: C:\Rust\.cargo\git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: ${{ github.workspace }}\target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }}
- name: Cache pip wheels
uses: actions/cache@v1
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
- name: Cache pacman
uses: actions/cache@v1
id: cache-pacman
with: with:
path: C:\Program Files\Git path: C:\Program Files\Git
key: ${{ runner.os }}-pacman-${{ hashFiles('**/windows_checks.yml') }} key: ${{ runner.os }}-pacman-${{ hashFiles('**/windows_checks.yml') }}
@ -78,26 +97,6 @@ jobs:
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: 12 node-version: 12
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: C:\Rust\.cargo\registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: C:\Rust\.cargo\git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: ${{ github.workspace }}\target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }}
- name: Cache pip wheels
uses: actions/cache@v1
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
- name: Run checks - name: Run checks
shell: cmd shell: cmd
run: | run: |
@ -115,5 +114,5 @@ jobs:
- name: Upload python wheels - name: Upload python wheels
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
with: with:
name: Windows python wheels name: windows_python_wheels
path: dist path: dist