From 4ff6e35a2c83d2c9489884faa4fd8ef6fdebbdb9 Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Mon, 23 Mar 2020 11:50:17 -0300 Subject: [PATCH] Cache pacman package manager and upload python wheels --- .github/workflows/linux_checks.yml | 15 +++++++++++++-- .github/workflows/mac_checks.yml | 11 +++++++++++ .github/workflows/windows_checks.yml | 18 ++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux_checks.yml b/.github/workflows/linux_checks.yml index d631d3511..0f489ea71 100644 --- a/.github/workflows/linux_checks.yml +++ b/.github/workflows/linux_checks.yml @@ -22,10 +22,16 @@ jobs: 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: # https://github.com/actions/cache/issues/133#issuecomment-599102035 - - name: Fix ~/.cargo directory permissions - run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/ + - name: Fix ~/.cache permissions + run: | + sudo chown -R $(whoami):$(id -ng) ~/.cargo/ - name: Cache cargo registry uses: actions/cache@v1 with: @@ -56,3 +62,8 @@ jobs: export RSPY_TARGET_DIR=~/target export CARGO_TARGET_DIR=~/target make build BUILDFLAGS="" + - name: Upload python wheels + uses: actions/upload-artifact@v1 + with: + name: Linux python wheels + path: dist diff --git a/.github/workflows/mac_checks.yml b/.github/workflows/mac_checks.yml index 59f4cbfa6..5ffb83e06 100644 --- a/.github/workflows/mac_checks.yml +++ b/.github/workflows/mac_checks.yml @@ -27,6 +27,12 @@ jobs: 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 uses: actions/cache@v1 with: @@ -57,3 +63,8 @@ jobs: export RSPY_TARGET_DIR=~/target export CARGO_TARGET_DIR=~/target make build BUILDFLAGS="" + - name: Upload python wheels + uses: actions/upload-artifact@v1 + with: + name: Mac OS python wheels + path: dist diff --git a/.github/workflows/windows_checks.yml b/.github/workflows/windows_checks.yml index 52a632804..dd82de5f8 100644 --- a/.github/workflows/windows_checks.yml +++ b/.github/workflows/windows_checks.yml @@ -22,7 +22,20 @@ jobs: echo "::set-env name=SCOOP::$env:GITHUB_WORKSPACE" echo "::set-env name=SCOOP_GLOBAL::$env:GITHUB_WORKSPACE\" echo "::set-env name=ANKI_EXTRA_PIP::python -m pip install $pyaudio" + - 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 pacman + id: cache-pacman + uses: actions/cache@v1 + with: + path: C:\Program Files\Git + key: ${{ runner.os }}-pacman-${{ hashFiles('**/windows_checks.yml') }} - name: Set up pacman, pyaudio, rsync, rename + if: steps.cache-pacman.outputs.cache-hit != 'true' shell: cmd run: | echo on @@ -99,3 +112,8 @@ jobs: set "RSPY_TARGET_DIR=%GITHUB_WORKSPACE%\target" set "CARGO_TARGET_DIR=%GITHUB_WORKSPACE%\target" make build BUILDFLAGS="" + - name: Upload python wheels + uses: actions/upload-artifact@v1 + with: + name: Windows python wheels + path: dist