Fixed not all rust libraries being cached

This commit is contained in:
evandrocoan 2020-03-23 23:39:05 -03:00
parent 131aee1a82
commit 136cd4da7c
4 changed files with 83 additions and 44 deletions

View file

@ -7,6 +7,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Configure environment variables
run: |
echo "::set-env name=BUILDFLAGS::"
echo "::set-env name=RSPY_TARGET_DIR::${GITHUB_WORKSPACE}/target"
echo "::set-env name=CARGO_TARGET_DIR::${GITHUB_WORKSPACE}/target"
# 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
@ -16,27 +21,37 @@ jobs:
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ~/.cargo/registry path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-1 key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-3-
- name: Cache cargo index - name: Cache cargo index
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ~/.cargo/git path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-1 key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-3-
- name: Cache cargo target - name: Cache cargo target
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ~/target path: ${{ github.workspace }}/target
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.toml') }}-1 key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.toml') }}-3-
- name: Cache cargo rslib
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/rslib/target
key: ${{ runner.os }}-cargo-rslib-${{ hashFiles('**/Cargo.toml') }}-3-
- name: Cache cargo rspy
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/rspy/target
key: ${{ runner.os }}-cargo-rspy-${{ hashFiles('**/Cargo.toml') }}-3-
- name: Cache pip wheels - name: Cache pip wheels
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ~/.cache/pip path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-1 key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-3-
- name: Cache pyenv - name: 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') }}-1 key: ${{ runner.os }}-pyenv-${{ hashFiles('**/Makefile') }}-${{ hashFiles('**/requirements.txt') }}-3-
- name: Set up python - name: Set up python
uses: actions/setup-python@v1 uses: actions/setup-python@v1
with: with:
@ -54,19 +69,16 @@ jobs:
sudo snap install ripgrep --classic sudo snap install ripgrep --classic
- name: Run develop - name: Run develop
run: | run: |
export RSPY_TARGET_DIR=~/target # export SHELLFLAGS=-x
export CARGO_TARGET_DIR=~/target make develop
make develop BUILDFLAGS=""
- name: Run build - name: Run build
run: | run: |
export RSPY_TARGET_DIR=~/target # export SHELLFLAGS=-x
export CARGO_TARGET_DIR=~/target make build
make build BUILDFLAGS=""
- name: Run check - name: Run check
run: | run: |
export RSPY_TARGET_DIR=~/target # export SHELLFLAGS=-x
export CARGO_TARGET_DIR=~/target make check
make check BUILDFLAGS=""
- name: Upload python wheels - name: Upload python wheels
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
with: with:

View file

@ -9,31 +9,51 @@ jobs:
runs-on: macOS-latest runs-on: macOS-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Configure environment variables
run: |
echo "::set-env name=BUILDFLAGS::"
echo "::set-env name=RSPY_TARGET_DIR::${GITHUB_WORKSPACE}/target"
echo "::set-env name=CARGO_TARGET_DIR::${GITHUB_WORKSPACE}/target"
# Necessary for now for the cargo cache:
# https://github.com/actions/cache/issues/133#issuecomment-599102035
- name: Fix ~/.cache permissions
run: |
sudo chown -R $(whoami):$(id -ng) ~/.cargo/
- name: Cache cargo registry - name: Cache cargo registry
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ~/.cargo/registry path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-1 key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-3-
- name: Cache cargo index - name: Cache cargo index
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ~/.cargo/git path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-1 key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-3-
- name: Cache cargo target - name: Cache cargo target
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ~/target path: ${{ github.workspace }}/target
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.toml') }}-1 key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.toml') }}-3-
- name: Cache cargo rslib
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/rslib/target
key: ${{ runner.os }}-cargo-rslib-${{ hashFiles('**/Cargo.toml') }}-3-
- name: Cache cargo rspy
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/rspy/target
key: ${{ runner.os }}-cargo-rspy-${{ hashFiles('**/Cargo.toml') }}-3-
- name: Cache pip wheels - name: Cache pip wheels
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ~/Library/Caches/pip path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-1 key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-3-
- name: Cache pyenv - name: 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') }}-1 key: ${{ runner.os }}-pyenv-${{ hashFiles('**/Makefile') }}-${{ hashFiles('**/requirements.txt') }}-3-
- name: Set up python - name: Set up python
uses: actions/setup-python@v1 uses: actions/setup-python@v1
with: with:
@ -50,18 +70,15 @@ jobs:
brew link gettext --force brew link gettext --force
- name: Run develop - name: Run develop
run: | run: |
export RSPY_TARGET_DIR=~/target # export SHELLFLAGS=-x
export CARGO_TARGET_DIR=~/target
make develop BUILDFLAGS="" make develop BUILDFLAGS=""
- name: Run build - name: Run build
run: | run: |
export RSPY_TARGET_DIR=~/target # export SHELLFLAGS=-x
export CARGO_TARGET_DIR=~/target
make build BUILDFLAGS="" make build BUILDFLAGS=""
- name: Run check - name: Run check
run: | run: |
export RSPY_TARGET_DIR=~/target # export SHELLFLAGS=-x
export CARGO_TARGET_DIR=~/target
make check BUILDFLAGS="" make check BUILDFLAGS=""
- name: Upload python wheels - name: Upload python wheels
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1

View file

@ -22,37 +22,50 @@ jobs:
echo "::set-env name=SCOOP::$env:GITHUB_WORKSPACE" echo "::set-env name=SCOOP::$env:GITHUB_WORKSPACE"
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"
echo "::set-env name=BUILDFLAGS::"
echo "::set-env name=RSPY_TARGET_DIR::$env:GITHUB_WORKSPACE\target"
echo "::set-env name=CARGO_TARGET_DIR::$env:GITHUB_WORKSPACE\target"
- name: Cache pyenv - name: 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') }}-1 key: ${{ runner.os }}-pyenv-${{ hashFiles('**/Makefile') }}-${{ hashFiles('**/requirements.txt') }}-3-
- name: Cache cargo registry - name: Cache cargo registry
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: C:\Rust\.cargo\registry path: C:\Rust\.cargo\registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-1 key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-3-
- name: Cache cargo index - name: Cache cargo index
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: C:\Rust\.cargo\git path: C:\Rust\.cargo\git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-1 key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-3-
- name: Cache cargo target - name: Cache cargo target
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ${{ github.workspace }}\target path: ${{ github.workspace }}\target
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.toml') }}-1 key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.toml') }}-3-
- name: Cache cargo rslib
uses: actions/cache@v1
with:
path: ${{ github.workspace }}\rslib\target
key: ${{ runner.os }}-cargo-rslib-${{ hashFiles('**/Cargo.toml') }}-3-
- name: Cache cargo rspy
uses: actions/cache@v1
with:
path: ${{ github.workspace }}\rspy\target
key: ${{ runner.os }}-cargo-rspy-${{ hashFiles('**/Cargo.toml') }}-3-
- name: Cache pip wheels - name: Cache pip wheels
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ~\AppData\Local\pip\Cache path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-1 key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-3-
- name: Cache pacman - name: Cache pacman
uses: actions/cache@v1 uses: actions/cache@v1
id: cache-pacman id: cache-pacman
with: with:
path: C:\Program Files\Git path: C:\Program Files\Git
key: ${{ runner.os }}-pacman-${{ hashFiles('**/windows_checks.yml') }}-1 key: ${{ runner.os }}-pacman-${{ hashFiles('**/windows_checks.yml') }}-3-
- name: Set up pacman, pyaudio, rsync, rename - name: Set up pacman, pyaudio, rsync, rename
if: steps.cache-pacman.outputs.cache-hit != 'true' if: steps.cache-pacman.outputs.cache-hit != 'true'
shell: cmd shell: cmd
@ -105,23 +118,20 @@ jobs:
shell: cmd shell: cmd
run: | run: |
echo on echo on
set "RSPY_TARGET_DIR=%GITHUB_WORKSPACE%\target" :: set "SHELLFLAGS=-x"
set "CARGO_TARGET_DIR=%GITHUB_WORKSPACE%\target" make develop
make develop BUILDFLAGS=""
- name: Run build - name: Run build
shell: cmd shell: cmd
run: | run: |
echo on echo on
set "RSPY_TARGET_DIR=%GITHUB_WORKSPACE%\target" :: set "SHELLFLAGS=-x"
set "CARGO_TARGET_DIR=%GITHUB_WORKSPACE%\target" make build
make build BUILDFLAGS=""
- name: Run check - name: Run check
shell: cmd shell: cmd
run: | run: |
echo on echo on
set "RSPY_TARGET_DIR=%GITHUB_WORKSPACE%\target" :: set "SHELLFLAGS=-x"
set "CARGO_TARGET_DIR=%GITHUB_WORKSPACE%\target" make check
make check BUILDFLAGS=""
- name: Upload python wheels - name: Upload python wheels
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
with: with:

View file

@ -70,7 +70,7 @@ pyenv:
VIRTUAL_ENV="$$(pwd)" && \ VIRTUAL_ENV="$$(pwd)" && \
VIRTUAL_ENV="$$(cygpath -m "$${VIRTUAL_ENV}")" && \ VIRTUAL_ENV="$$(cygpath -m "$${VIRTUAL_ENV}")" && \
sed -i -- "s@VIRTUAL_ENV=\".*\"@VIRTUAL_ENV=\"$$(pwd)/pyenv\"@g" "${ACTIVATE_SCRIPT}" && \ sed -i -- "s@VIRTUAL_ENV=\".*\"@VIRTUAL_ENV=\"$$(pwd)/pyenv\"@g" "${ACTIVATE_SCRIPT}" && \
sed -i -- "s@export PATH@export PATH; VIRTUAL_ENV=\"$${VIRTUAL_ENV}/pyenv\";@g" "${ACTIVATE_SCRIPT}" \ sed -i -- "s@export PATH@export PATH; VIRTUAL_ENV=\"$${VIRTUAL_ENV}/pyenv\";@g" "${ACTIVATE_SCRIPT}"; \
;; esac && \ ;; esac && \
. "${ACTIVATE_SCRIPT}" && \ . "${ACTIVATE_SCRIPT}" && \
python --version && \ python --version && \