* actions * add build scripts * chmod +x * remove clang env * add ARM builds * install LLVM for Windows * check LLVM * remove fi * check platform * fix LLVM install on windows * diff cache * remove unexpected token && * remove build directory cache from windows * remove Show ENV * fix cross and RUSTFLAGS * final fix for ARM and Windows build * typo * fix PATH for artifacts * sudo for install set PATH . for artifacts.zip * target names for artifacts * platform names for artifacts * remove ARM builds PLATFORM for build scripts * remove PLATFORM and change PATH for artifacts.zip * change PATH for artifacts * fix sccache * set sccache env * Update install-sccache.ps1 * Update install-sccache.ps1 * global env * set global sccache env * SCCACHE_CACHE_SIZE "1G" SCCACHE_IDLE_TIMEOUT 0 * Update build-windows.sh
104 lines
4.7 KiB
YAML
104 lines
4.7 KiB
YAML
name: Build and Test Suite
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- master
|
|
- stable
|
|
jobs:
|
|
build-tests:
|
|
name: Test and Build
|
|
env:
|
|
SCCACHE_CACHE_SIZE: "1G"
|
|
SCCACHE_IDLE_TIMEOUT: 0
|
|
strategy:
|
|
matrix:
|
|
platform:
|
|
- ubuntu-16.04
|
|
- macos-latest
|
|
- windows-latest
|
|
toolchain:
|
|
- stable
|
|
runs-on: ${{ matrix.platform }}
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@master
|
|
with:
|
|
submodules: true
|
|
# https://github.com/actions/cache/issues/133
|
|
- name: Fixup the owner of ~/.cargo/
|
|
if: matrix.platform == 'ubuntu-16.04'
|
|
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
|
|
- name: Install toolchain
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ matrix.toolchain }}
|
|
profile: minimal
|
|
override: true
|
|
- name: Cache cargo registry
|
|
uses: actions/cache@v1.1.2
|
|
with:
|
|
path: ~/.cargo/registry
|
|
key: ${{ runner.os }}-cargo-registry-build-tests-${{ hashFiles('**/Cargo.lock') }}
|
|
- name: Cache cargo index
|
|
uses: actions/cache@v1.1.2
|
|
with:
|
|
path: ~/.cargo/git
|
|
key: ${{ runner.os }}-cargo-git-build-tests-${{ hashFiles('**/Cargo.lock') }}
|
|
- name: Cache cargo build
|
|
uses: actions/cache@v1.1.2
|
|
with:
|
|
path: target
|
|
key: ${{ runner.os }}-cargo-build-target-build-tests-${{ hashFiles('**/Cargo.lock') }}
|
|
- name: Cache sccache linux
|
|
if: matrix.platform == 'ubuntu-16.04'
|
|
uses: actions/cache@v1.1.2
|
|
with:
|
|
path: "/home/runner/.cache/sccache"
|
|
key: ${{ runner.os }}-sccache-build-tests-${{ hashFiles('**/Cargo.lock') }}
|
|
- name: Cache sccache MacOS
|
|
if: matrix.platform == 'macos-latest'
|
|
uses: actions/cache@v1.1.2
|
|
with:
|
|
path: "/Users/runner/Library/Caches/Mozilla.sccache"
|
|
key: ${{ runner.os }}-sccache-build-tests-${{ hashFiles('**/Cargo.lock') }}
|
|
- name: Cache sccache Windows
|
|
if: matrix.platform == 'windows-latest'
|
|
uses: actions/cache@v1.1.2
|
|
with:
|
|
path: "C:\\Users\\runneradmin\\AppData\\Local\\Mozilla\\sccache\\cache"
|
|
key: ${{ runner.os }}-sccache-build-tests-${{ hashFiles('**/Cargo.lock') }}
|
|
- name: Install sccache for ${{ matrix.platform }}
|
|
shell: pwsh
|
|
run: pwsh scripts/actions/install-sccache.ps1 ${{ runner.os}}
|
|
- name: Install LLVM for Windows
|
|
if: matrix.platform == 'windows-latest'
|
|
run: choco install llvm
|
|
- name: Sccache statistics
|
|
run: sccache --show-stats
|
|
- name: Build tests
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --locked --all --release --features "json-tests" --verbose --no-run
|
|
- name: Run tests for ${{ matrix.platform }}
|
|
if: matrix.platform == 'windows-latest'
|
|
continue-on-error: true #Skip step if Windows tests failure
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --locked --all --release --features "json-tests" --verbose
|
|
- name: Run tests for ${{ matrix.platform }}
|
|
if: matrix.platform != 'windows-latest'
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --locked --all --release --features "json-tests" --verbose
|
|
- name: Stop sccache
|
|
if: always()
|
|
run: sccache --stop-server
|
|
- name: Prepare build directory for cache
|
|
shell: bash
|
|
run: bash scripts/actions/clean-target.sh
|