You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.6 KiB
YAML

name: Test (push)
on: [push]
env:
IS_ACTIONS_DOC: "false"
IS_MD_FILE: "false"
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [linux-stable, macos-stable, windows-stable]
include:
- build: linux-stable
os: ubuntu-latest
rust: stable
- build: macos-stable
os: macos-latest
rust: stable
- build: windows-stable
os: windows-latest
rust: stable
steps:
4 years ago
- name: Checkout source code
uses: actions/checkout@v2
with:
4 years ago
fetch-depth: 2
- name: "Prepare build environment"
run: |
chmod +x ci/setvars.sh
ci/setvars.sh
- name: Cache Cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ matrix.build }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ matrix.build }}-cargo-registry-
# HACK(@ohsayan): The next line skips caching until it is fixed
if: runner.os != 'macOS' && env.IS_MD_FILE == 'false'
- name: Cache Cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ matrix.build }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ matrix.build }}-cargo-index-
# HACK(@ohsayan): The next line skips caching until it is fixed
if: runner.os != 'macOS' && env.IS_MD_FILE == 'false'
- name: Cache Cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ matrix.build }}-target-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ matrix.build }}-target-
# HACK(@ohsayan): The next line skips caching until it is fixed
if: runner.os != 'macOS' && env.IS_MD_FILE == 'false'
- name: Install Rust
run: |
rustup update ${{ matrix.rust }} --no-self-update
rustup default ${{ matrix.rust }}
if: env.IS_MD_FILE == 'false'
- name: Publish docs
env:
BOT_USER: ${{ secrets.BOT_INIT_USER }}
BOT_MAIL: ${{ secrets.BOT_INIT_MAIL }}
BOT_API: ${{ secrets.BOT_API_CALL }}
GIT_SHA: ${{ env.GITHUB_SHA }}
run: |
chmod +x ci/doc.sh
ci/doc.sh
if: runner.os == 'Linux' && env.IS_ACTIONS_DOC == 'true'
- name: Run Tests
run: cargo test --verbose -- --test-threads=1
env:
RUST_BACKTRACE: 1
if: env.IS_MD_FILE == 'false'