diff --git a/.github/workflows/linux_checks.yml b/.github/workflows/linux_checks.yml index c792b0ff3..328cecd58 100644 --- a/.github/workflows/linux_checks.yml +++ b/.github/workflows/linux_checks.yml @@ -7,6 +7,11 @@ jobs: runs-on: ubuntu-latest steps: - 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 @@ -16,27 +21,37 @@ jobs: uses: actions/cache@v1 with: 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 uses: actions/cache@v1 with: 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 uses: actions/cache@v1 with: - path: ~/target - key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.toml') }}-1 + path: ${{ github.workspace }}/target + 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 uses: actions/cache@v1 with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-1 + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-3- - name: Cache pyenv uses: actions/cache@v1 with: 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 uses: actions/setup-python@v1 with: @@ -54,19 +69,16 @@ jobs: sudo snap install ripgrep --classic - name: Run develop run: | - export RSPY_TARGET_DIR=~/target - export CARGO_TARGET_DIR=~/target - make develop BUILDFLAGS="" + # export SHELLFLAGS=-x + make develop - name: Run build run: | - export RSPY_TARGET_DIR=~/target - export CARGO_TARGET_DIR=~/target - make build BUILDFLAGS="" + # export SHELLFLAGS=-x + make build - name: Run check run: | - export RSPY_TARGET_DIR=~/target - export CARGO_TARGET_DIR=~/target - make check BUILDFLAGS="" + # export SHELLFLAGS=-x + make check - name: Upload python wheels uses: actions/upload-artifact@v1 with: diff --git a/.github/workflows/mac_checks.yml.off b/.github/workflows/mac_checks.yml.off index 02d285d9a..5e2f86d73 100644 --- a/.github/workflows/mac_checks.yml.off +++ b/.github/workflows/mac_checks.yml.off @@ -9,31 +9,51 @@ jobs: runs-on: macOS-latest steps: - 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 uses: actions/cache@v1 with: 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 uses: actions/cache@v1 with: 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 uses: actions/cache@v1 - with: - path: ~/target - key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.toml') }}-1 + with: + path: ${{ github.workspace }}/target + 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 uses: actions/cache@v1 with: path: ~/Library/Caches/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-1 + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-3- - name: Cache pyenv uses: actions/cache@v1 with: 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 uses: actions/setup-python@v1 with: @@ -50,18 +70,15 @@ jobs: brew link gettext --force - name: Run develop run: | - export RSPY_TARGET_DIR=~/target - export CARGO_TARGET_DIR=~/target + # export SHELLFLAGS=-x make develop BUILDFLAGS="" - name: Run build run: | - export RSPY_TARGET_DIR=~/target - export CARGO_TARGET_DIR=~/target + # export SHELLFLAGS=-x make build BUILDFLAGS="" - name: Run check run: | - export RSPY_TARGET_DIR=~/target - export CARGO_TARGET_DIR=~/target + # export SHELLFLAGS=-x make check BUILDFLAGS="" - name: Upload python wheels uses: actions/upload-artifact@v1 diff --git a/.github/workflows/windows_checks.yml b/.github/workflows/windows_checks.yml index 6d03dd484..c02fdc875 100644 --- a/.github/workflows/windows_checks.yml +++ b/.github/workflows/windows_checks.yml @@ -22,37 +22,50 @@ 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" + 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 uses: actions/cache@v1 with: 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 uses: actions/cache@v1 with: 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 uses: actions/cache@v1 with: 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 uses: actions/cache@v1 with: 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 uses: actions/cache@v1 with: path: ~\AppData\Local\pip\Cache - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-1 + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-3- - name: Cache pacman uses: actions/cache@v1 id: cache-pacman with: 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 if: steps.cache-pacman.outputs.cache-hit != 'true' shell: cmd @@ -105,23 +118,20 @@ jobs: shell: cmd run: | echo on - set "RSPY_TARGET_DIR=%GITHUB_WORKSPACE%\target" - set "CARGO_TARGET_DIR=%GITHUB_WORKSPACE%\target" - make develop BUILDFLAGS="" + :: set "SHELLFLAGS=-x" + make develop - name: Run build shell: cmd run: | echo on - set "RSPY_TARGET_DIR=%GITHUB_WORKSPACE%\target" - set "CARGO_TARGET_DIR=%GITHUB_WORKSPACE%\target" - make build BUILDFLAGS="" + :: set "SHELLFLAGS=-x" + make build - name: Run check shell: cmd run: | echo on - set "RSPY_TARGET_DIR=%GITHUB_WORKSPACE%\target" - set "CARGO_TARGET_DIR=%GITHUB_WORKSPACE%\target" - make check BUILDFLAGS="" + :: set "SHELLFLAGS=-x" + make check - name: Upload python wheels uses: actions/upload-artifact@v1 with: diff --git a/Makefile b/Makefile index 0a0a06cba..c40bdf2e5 100644 --- a/Makefile +++ b/Makefile @@ -70,7 +70,7 @@ pyenv: VIRTUAL_ENV="$$(pwd)" && \ VIRTUAL_ENV="$$(cygpath -m "$${VIRTUAL_ENV}")" && \ 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 && \ . "${ACTIVATE_SCRIPT}" && \ python --version && \