2020-03-25 01:59:20 +01:00
|
|
|
name: Checks
|
2019-12-22 03:15:18 +01:00
|
|
|
|
2019-12-22 09:39:14 +01:00
|
|
|
on: [push, pull_request]
|
2019-12-22 03:15:18 +01:00
|
|
|
|
|
|
|
jobs:
|
2020-03-25 01:59:20 +01:00
|
|
|
linux_tests:
|
2019-12-22 03:15:18 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-01-02 10:43:19 +01:00
|
|
|
- uses: actions/checkout@v2
|
2020-03-24 03:39:05 +01:00
|
|
|
- name: Configure environment variables
|
|
|
|
run: |
|
2020-03-24 20:29:27 +01:00
|
|
|
# echo "::set-env name=SHELLFLAGS::-x"
|
2020-03-24 03:39:05 +01:00
|
|
|
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"
|
2020-03-23 01:10:16 +01:00
|
|
|
# Necessary for now for the cargo cache:
|
|
|
|
# https://github.com/actions/cache/issues/133#issuecomment-599102035
|
2020-03-23 15:50:17 +01:00
|
|
|
- name: Fix ~/.cache permissions
|
|
|
|
run: |
|
|
|
|
sudo chown -R $(whoami):$(id -ng) ~/.cargo/
|
2020-03-23 01:10:16 +01:00
|
|
|
- name: Cache cargo registry
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/registry
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-8-
|
2020-03-23 01:10:16 +01:00
|
|
|
- name: Cache cargo index
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/git
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-8-
|
2020-03-23 20:13:00 +01:00
|
|
|
- name: Cache cargo target
|
2020-03-23 01:10:16 +01:00
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
2020-03-24 03:39:05 +01:00
|
|
|
path: ${{ github.workspace }}/target
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.toml') }}-8-
|
2020-03-24 03:39:05 +01:00
|
|
|
- name: Cache cargo rslib
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}/rslib/target
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-cargo-rslib-${{ hashFiles('**/Cargo.toml') }}-8-
|
2020-03-24 03:39:05 +01:00
|
|
|
- name: Cache cargo rspy
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}/rspy/target
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-cargo-rspy-${{ hashFiles('**/Cargo.toml') }}-8-
|
2020-03-23 01:10:16 +01:00
|
|
|
- name: Cache pip wheels
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-8-
|
2020-03-23 18:13:27 +01:00
|
|
|
- name: Cache pyenv
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}/pyenv
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-pyenv-${{ hashFiles('**/Makefile') }}-${{ hashFiles('**/requirements.txt') }}-8-
|
2020-03-23 18:13:27 +01:00
|
|
|
- name: Set up python
|
|
|
|
uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: 3.7
|
|
|
|
- name: Set up protoc
|
2020-03-25 20:28:48 +01:00
|
|
|
uses: ankitects/setup-protoc@master
|
2020-03-24 17:51:59 +01:00
|
|
|
with:
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
2020-03-23 18:13:27 +01:00
|
|
|
- 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
|
2020-03-24 20:29:27 +01:00
|
|
|
- run: make develop
|
|
|
|
- run: make build
|
2020-03-25 01:51:41 +01:00
|
|
|
- run: make check
|
2020-03-23 15:50:17 +01:00
|
|
|
- name: Upload python wheels
|
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
with:
|
2020-03-23 20:13:00 +01:00
|
|
|
name: anki_linux_python_wheels
|
2020-03-23 15:50:17 +01:00
|
|
|
path: dist
|
2020-03-25 01:59:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
mac_os_tests:
|
2020-03-25 05:57:03 +01:00
|
|
|
runs-on: macos-latest
|
2020-03-25 01:59:20 +01:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Configure environment variables
|
|
|
|
run: |
|
|
|
|
# echo "::set-env name=SHELLFLAGS::-x"
|
|
|
|
echo "::set-env name=BUILDFLAGS::"
|
2020-03-26 05:20:00 +01:00
|
|
|
# Update make to use the new `.SHELLFLAGS` feature
|
|
|
|
# https://stackoverflow.com/questions/43175529/updating-make-version-4-1-on-mac
|
|
|
|
echo "::set-env name=PATH::/usr/local/opt/make/libexec/gnubin:$PATH"
|
2020-03-26 02:05:46 +01:00
|
|
|
# Disabled for Mac OS because it was not reusing the cached files
|
|
|
|
# https://github.com/ankitects/anki/pull/528
|
|
|
|
# echo "::set-env name=RSPY_TARGET_DIR::${GITHUB_WORKSPACE}/target"
|
|
|
|
# echo "::set-env name=CARGO_TARGET_DIR::${GITHUB_WORKSPACE}/target"
|
2020-03-25 01:59:20 +01:00
|
|
|
# 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
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-8-
|
2020-03-25 01:59:20 +01:00
|
|
|
- name: Cache cargo index
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/git
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-8-
|
2020-03-25 01:59:20 +01:00
|
|
|
- name: Cache cargo target
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}/target
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.toml') }}-8-
|
2020-03-25 01:59:20 +01:00
|
|
|
- name: Cache cargo rslib
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}/rslib/target
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-cargo-rslib-${{ hashFiles('**/Cargo.toml') }}-8-
|
2020-03-25 01:59:20 +01:00
|
|
|
- name: Cache cargo rspy
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}/rspy/target
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-cargo-rspy-${{ hashFiles('**/Cargo.toml') }}-8-
|
2020-03-25 01:59:20 +01:00
|
|
|
- name: Cache pip wheels
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/Library/Caches/pip
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-8-
|
2020-03-25 01:59:20 +01:00
|
|
|
- name: Cache pyenv
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}/pyenv
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-pyenv-${{ hashFiles('**/Makefile') }}-${{ hashFiles('**/requirements.txt') }}-8-
|
2020-03-25 01:59:20 +01:00
|
|
|
- name: Set up python
|
|
|
|
uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: 3.7
|
|
|
|
- name: Set up protoc
|
2020-03-25 20:28:48 +01:00
|
|
|
uses: ankitects/setup-protoc@master
|
2020-03-25 01:59:20 +01:00
|
|
|
with:
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set up node
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12
|
|
|
|
- name: Set up brew packages
|
|
|
|
run: |
|
2020-03-25 20:55:04 +01:00
|
|
|
brew install portaudio protobuf gettext rename ripgrep make
|
2020-03-25 01:59:20 +01:00
|
|
|
brew link gettext --force
|
|
|
|
- run: make develop
|
|
|
|
- run: make build
|
2020-03-25 01:51:41 +01:00
|
|
|
- run: make check
|
2020-03-25 01:59:20 +01:00
|
|
|
- name: Upload python wheels
|
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
with:
|
|
|
|
name: anki_mac_os_python_wheels
|
|
|
|
path: dist
|
|
|
|
|
|
|
|
|
|
|
|
windows_tests:
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
|
|
- run: git config --global core.autocrlf false
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Configure environment variables
|
|
|
|
run: |
|
|
|
|
# echo "::set-env name=SHELLFLAGS::-x"
|
|
|
|
$pyaudio=("PyAudio-0.2.11-cp37-cp37m-win_amd64.whl")
|
|
|
|
$new_path=("$env:GITHUB_WORKSPACE;$env:PATH")
|
|
|
|
$new_path=("$env:GITHUB_WORKSPACE\shims;$new_path")
|
|
|
|
echo "::set-env name=pacmanbin::pacman-5.1.1-3-x86_64.pkg.tar.xz"
|
|
|
|
echo "::set-env name=pacmanmirror::pacman-mirrors-20200307-1-any.pkg.tar.xz"
|
|
|
|
echo "::set-env name=pacmankeys::msys2-keyring-r9.397a52e-1-any.pkg.tar.xz"
|
|
|
|
echo "::set-env name=pyaudio::$pyaudio"
|
|
|
|
echo "::set-env name=PATH::$new_path"
|
|
|
|
echo "::set-env name=RUST_BACKTRACE::full"
|
|
|
|
echo "::set-env name=SCOOP::$env:GITHUB_WORKSPACE"
|
2020-03-25 03:51:44 +01:00
|
|
|
echo "::set-env name=SCOOP_GLOBAL::$env:GITHUB_WORKSPACE"
|
2020-03-25 01:59:20 +01:00
|
|
|
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
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-pyenv-${{ hashFiles('**/Makefile') }}-${{ hashFiles('**/requirements.txt') }}-8-
|
2020-03-25 01:59:20 +01:00
|
|
|
- name: Cache cargo registry
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: C:\Rust\.cargo\registry
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-8-
|
2020-03-25 01:59:20 +01:00
|
|
|
- name: Cache cargo index
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: C:\Rust\.cargo\git
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-8-
|
2020-03-25 01:59:20 +01:00
|
|
|
- name: Cache cargo target
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}\target
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.toml') }}-8-
|
2020-03-25 01:59:20 +01:00
|
|
|
- name: Cache cargo rslib
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}\rslib\target
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-cargo-rslib-${{ hashFiles('**/Cargo.toml') }}-8-
|
2020-03-25 01:59:20 +01:00
|
|
|
- name: Cache cargo rspy
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}\rspy\target
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-cargo-rspy-${{ hashFiles('**/Cargo.toml') }}-8-
|
2020-03-25 01:59:20 +01:00
|
|
|
- name: Cache pip wheels
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~\AppData\Local\pip\Cache
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-8-
|
2020-03-25 01:59:20 +01:00
|
|
|
- name: Cache pacman
|
|
|
|
uses: actions/cache@v1
|
|
|
|
id: cache-pacman
|
|
|
|
with:
|
|
|
|
path: C:\Program Files\Git
|
2020-03-26 02:05:46 +01:00
|
|
|
key: ${{ runner.os }}-pacman-${{ hashFiles('**/checks.yml') }}-8-
|
2020-03-25 01:59:20 +01:00
|
|
|
- name: Set up pacman, rsync
|
|
|
|
if: steps.cache-pacman.outputs.cache-hit != 'true'
|
|
|
|
shell: cmd
|
|
|
|
run: |
|
|
|
|
echo on
|
|
|
|
curl -LO http://repo.msys2.org/msys/x86_64/%pacmanbin%
|
|
|
|
curl -LO http://repo.msys2.org/msys/x86_64/%pacmanmirror%
|
|
|
|
curl -LO http://repo.msys2.org/msys/x86_64/%pacmankeys%
|
|
|
|
:: https://stackoverflow.com/questions/1359793/programmatically-extract-tar-gz
|
|
|
|
7z x "%pacmanbin%" -so | 7z x -aoa -si -ttar -o"%programfiles%\Git"
|
|
|
|
7z x "%pacmanmirror%" -so | 7z x -aoa -si -ttar -o"%programfiles%\Git"
|
|
|
|
7z x "%pacmankeys%" -so | 7z x -aoa -si -ttar -o"%programfiles%\Git"
|
|
|
|
:: Manually Install Pacman Binaries
|
|
|
|
:: https://github.com/Alexpux/MSYS2-pacman/issues/50
|
|
|
|
set "PATH=%programfiles%\Git\usr\bin"
|
|
|
|
bash pacman-key --init
|
|
|
|
bash pacman-key --populate msys2
|
|
|
|
bash pacman-key --refresh-keys
|
|
|
|
pacman -Tv
|
|
|
|
pacman -Syyuuv --overwrite='*'
|
|
|
|
pacman -Syuuv --overwrite='*'
|
|
|
|
pacman --version
|
|
|
|
:: We must install bash first, otherwise we will have bash fork errors:
|
|
|
|
:: https://github.com/evandroforks/anki/runs/524857054?check_suite_focus=true
|
|
|
|
:: 0 [main] pacman 748 dofork: child -1 - forked process 2896 died unexpectedly
|
|
|
|
pacman -Sv --noconfirm --overwrite='*' bash
|
|
|
|
pacman -Sv --noconfirm --overwrite='*' rsync
|
|
|
|
:: clean all packages to decrease image size
|
|
|
|
pacman -Sccv --noconfirm
|
|
|
|
pacman -Qsv --noconfirm
|
|
|
|
- name: Set up pyaudio, rename
|
|
|
|
shell: cmd
|
|
|
|
run: |
|
|
|
|
echo on
|
|
|
|
curl -LO https://download.lfd.uci.edu/pythonlibs/s2jqpv5t/%pyaudio%
|
|
|
|
curl -LO https://raw.githubusercontent.com/subogero/rename/master/rename
|
|
|
|
- name: Set up scoop, gettext, ripgrep
|
|
|
|
shell: cmd
|
|
|
|
run: |
|
|
|
|
echo on
|
|
|
|
powershell -executionpolicy bypass "& Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')"
|
|
|
|
scoop install -g gettext ripgrep
|
|
|
|
- name: Set up python
|
|
|
|
uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: 3.7
|
|
|
|
- name: Set up protoc
|
2020-03-25 20:28:48 +01:00
|
|
|
uses: ankitects/setup-protoc@master
|
2020-03-25 01:59:20 +01:00
|
|
|
with:
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set up node
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12
|
|
|
|
- run: make develop
|
|
|
|
- run: make build
|
2020-03-25 01:51:41 +01:00
|
|
|
- run: make check
|
2020-03-25 01:59:20 +01:00
|
|
|
- name: Upload python wheels
|
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
with:
|
|
|
|
name: anki_windows_python_wheels
|
|
|
|
path: dist
|