Created a fast build matrix for quickly running the Unit Tests

This commit is contained in:
evandrocoan 2020-03-26 16:39:34 -03:00
parent b07454ca0c
commit 76bf3f8a03

View file

@ -4,11 +4,12 @@ on: [push, pull_request]
jobs: jobs:
tests: tests:
name: Test ${{ matrix.os }} name: ${{ matrix.os }} ${{ matrix.BUILD_TYPE }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ] os: [ ubuntu-latest, macos-latest, windows-latest ]
BUILD_TYPE: [check, build]
include: include:
- os: ubuntu-latest - os: ubuntu-latest
SEP: / SEP: /
@ -31,6 +32,9 @@ jobs:
CARGO_REGISTRY_DIR: C:\Rust\.cargo\registry CARGO_REGISTRY_DIR: C:\Rust\.cargo\registry
ANKI_PYTHON_WHEELS: anki_windows_python_wheels ANKI_PYTHON_WHEELS: anki_windows_python_wheels
# Keep running all matrices if something fail
fail-fast: false
steps: steps:
- run: git config --global core.autocrlf false - run: git config --global core.autocrlf false
if: matrix.os == 'windows-latest' if: matrix.os == 'windows-latest'
@ -93,43 +97,43 @@ jobs:
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ${{ matrix.PIP_WHEELS_DIR }} path: ${{ matrix.PIP_WHEELS_DIR }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-8- key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-11-
- name: Cache pyenv - name: Cache pyenv
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ${{ github.workspace }}${{ matrix.SEP }}pyenv path: ${{ github.workspace }}${{ matrix.SEP }}pyenv
key: ${{ runner.os }}-pyenv-${{ hashFiles('**/Makefile') }}-${{ hashFiles('**/requirements.txt') }}-8- key: ${{ runner.os }}-pyenv-${{ hashFiles('**/Makefile') }}-${{ hashFiles('**/requirements.txt') }}-11-
- name: Cache cargo index - name: Cache cargo index
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ${{ matrix.CARGO_INDEX_DIR }} path: ${{ matrix.CARGO_INDEX_DIR }}
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-8- key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-11-
- name: Cache cargo registry - name: Cache cargo registry
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ${{ matrix.CARGO_REGISTRY_DIR }} path: ${{ matrix.CARGO_REGISTRY_DIR }}
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-8- key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-11-
- name: Cache cargo target - name: Cache cargo target
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ${{ github.workspace }}${{ matrix.SEP }}target path: ${{ github.workspace }}${{ matrix.SEP }}target
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.toml') }}-8- key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.toml') }}-$${{ matrix.BUILD_TYPE }}-11-
- name: Cache cargo rslib - name: Cache cargo rslib
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ${{ github.workspace }}${{ matrix.SEP }}rslib${{ matrix.SEP }}target path: ${{ github.workspace }}${{ matrix.SEP }}rslib${{ matrix.SEP }}target
key: ${{ runner.os }}-cargo-rslib-${{ hashFiles('**/Cargo.toml') }}-8- key: ${{ runner.os }}-cargo-rslib-${{ hashFiles('**/Cargo.toml') }}-$${{ matrix.BUILD_TYPE }}-11-
- name: Cache cargo rspy - name: Cache cargo rspy
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ${{ github.workspace }}${{ matrix.SEP }}rspy${{ matrix.SEP }}target path: ${{ github.workspace }}${{ matrix.SEP }}rspy${{ matrix.SEP }}target
key: ${{ runner.os }}-cargo-rspy-${{ hashFiles('**/Cargo.toml') }}-8- key: ${{ runner.os }}-cargo-rspy-${{ hashFiles('**/Cargo.toml') }}-$${{ matrix.BUILD_TYPE }}-11-
- name: Cache pacman - name: Cache pacman
if: matrix.os == 'windows-latest' if: matrix.os == 'windows-latest'
@ -137,7 +141,7 @@ jobs:
id: cache-pacman id: cache-pacman
with: with:
path: C:\Program Files\Git path: C:\Program Files\Git
key: ${{ runner.os }}-pacman-${{ hashFiles('**/checks.yml') }}-8- key: ${{ runner.os }}-pacman-${{ hashFiles('**/checks.yml') }}-11-
- name: Set up pacman, rsync - name: Set up pacman, rsync
if: matrix.os == 'windows-latest' && steps.cache-pacman.outputs.cache-hit != 'true' if: matrix.os == 'windows-latest' && steps.cache-pacman.outputs.cache-hit != 'true'
@ -219,10 +223,16 @@ jobs:
node-version: 12 node-version: 12
- run: make develop - run: make develop
if: matrix.BUILD_TYPE != 'check'
- run: make build - run: make build
if: matrix.BUILD_TYPE != 'check'
- run: make check - run: make check
if: matrix.BUILD_TYPE == 'check'
- name: Upload python wheels - name: Upload python wheels
if: matrix.BUILD_TYPE != 'check'
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
with: with:
name: ${{ matrix.ANKI_PYTHON_WHEELS }} name: ${{ matrix.ANKI_PYTHON_WHEELS }}