2020-03-22 19:52:56 +01:00
|
|
|
name: Linux Tests
|
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:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-01-02 10:43:19 +01:00
|
|
|
- uses: actions/checkout@v2
|
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-24 00:12:14 +01:00
|
|
|
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-1
|
2020-03-23 01:10:16 +01:00
|
|
|
- name: Cache cargo index
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/git
|
2020-03-24 00:12:14 +01:00
|
|
|
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-1
|
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:
|
|
|
|
path: ~/target
|
2020-03-24 00:12:14 +01:00
|
|
|
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.toml') }}-1
|
2020-03-23 01:10:16 +01:00
|
|
|
- name: Cache pip wheels
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
2020-03-24 00:12:14 +01:00
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-1
|
2020-03-23 18:13:27 +01:00
|
|
|
- name: Cache pyenv
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}/pyenv
|
2020-03-24 00:12:14 +01:00
|
|
|
key: ${{ runner.os }}-pyenv-${{ hashFiles('**/Makefile') }}-${{ hashFiles('**/requirements.txt') }}-1
|
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
|
|
|
|
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
|
2020-03-23 20:13:00 +01:00
|
|
|
- name: Run develop
|
2020-03-23 01:10:16 +01:00
|
|
|
run: |
|
2020-03-23 03:34:22 +01:00
|
|
|
export RSPY_TARGET_DIR=~/target
|
|
|
|
export CARGO_TARGET_DIR=~/target
|
2020-03-23 20:13:00 +01:00
|
|
|
make develop BUILDFLAGS=""
|
2020-03-23 01:10:16 +01:00
|
|
|
- name: Run build
|
|
|
|
run: |
|
2020-03-23 03:34:22 +01:00
|
|
|
export RSPY_TARGET_DIR=~/target
|
|
|
|
export CARGO_TARGET_DIR=~/target
|
|
|
|
make build BUILDFLAGS=""
|
2020-03-23 20:13:00 +01:00
|
|
|
- name: Run check
|
|
|
|
run: |
|
|
|
|
export RSPY_TARGET_DIR=~/target
|
|
|
|
export CARGO_TARGET_DIR=~/target
|
|
|
|
make check BUILDFLAGS=""
|
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
|