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.

103 lines
2.7 KiB
YAML

name: Test (push)
on:
push:
branches:
- "!v*"
- "**"
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: Install GNU tar
run: |
brew install gnu-tar
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
if: runner.os == 'macOS'
- 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-
if: 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-
if: 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-
if: 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
env:
RUST_BACKTRACE: 1
if: env.IS_MD_FILE == 'false' && runner.os != 'Windows'
- name: Run Tests (Windows)
run: cargo test --verbose
env:
RUST_BACKTRACE: 1
shell: cmd
if: env.IS_MD_FILE == 'false' && runner.os == 'Windows'