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.

230 lines
6.3 KiB
YAML

name: Test (push)
on:
push:
branches:
- "!v*"
- "**"
env:
IS_ACTIONS_DOC: "false"
IS_MD_FILE: "false"
jobs:
tests-pass:
name: Tier 1 Tests
runs-on: ubuntu-latest
needs:
- test_64bit
- test_32bit
steps:
- run: exit 0
test_64bit:
name: Test (64-bit)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
rust: x86_64-unknown-linux-gnu
- os: macos-latest
rust: x86_64-apple-darwin
- os: windows-latest
rust: x86_64-pc-windows-msvc
steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
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: Setup environment
run: |
chmod +x ci/setvars.sh
ci/setvars.sh
- name: Cache Cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ matrix.rust }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ matrix.rust }}-cargo-registry-
if: env.IS_MD_FILE == 'false'
- name: Cache Cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: ${{ matrix.rust }}-cargo-index-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ matrix.rust }}-cargo-index-
if: env.IS_MD_FILE == 'false'
- name: Cache Cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ matrix.rust }}-target-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ matrix.rust }}-target-
if: env.IS_MD_FILE == 'false'
- name: Install Rust
run: |
rustup default stable
rustup target add ${{ 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 --target ${{ matrix.rust }}
env:
RUST_BACKTRACE: 1
if: env.IS_MD_FILE == 'false' && runner.os != 'Windows'
- name: Run Tests (Windows)
run: cargo test --verbose --target ${{ matrix.rust }}
env:
RUST_BACKTRACE: 1
shell: cmd
if: env.IS_MD_FILE == 'false' && runner.os == 'Windows'
- name: Archive artifacts
run: |
mkdir dist
cargo build
mv target/debug/skyd target/debug/skysh target/debug/sky-bench dist
if: env.IS_MD_FILE == 'false' && runner.os != 'Windows'
- name: Archive artifacts
shell: cmd
run: |
cargo build
rm -rf dist
mkdir dist
move target\debug\*.exe dist
env:
RUSTFLAGS: -Ctarget-feature=+crt-static
if: env.IS_MD_FILE == 'false' && runner.os == 'Windows'
- name: Save artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ github.sha }}-${{ matrix.rust }}-builds.zip
path: dist
if: env.IS_MD_FILE == 'false'
test_32bit:
name: Test (32-bit)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: ubuntu-latest
rust: i686-unknown-linux-gnu
- os: windows-latest
rust: i686-pc-windows-msvc
steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Setup environment
run: |
chmod +x ci/setvars.sh
ci/setvars.sh
- name: Cache Cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ matrix.rust }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ matrix.rust }}-cargo-registry-
if: env.IS_MD_FILE == 'false'
- name: Cache Cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: ${{ matrix.rust }}-cargo-index-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ matrix.rust }}-cargo-index-
if: env.IS_MD_FILE == 'false'
- name: Cache Cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ matrix.rust }}-target-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ matrix.rust }}-target-
if: env.IS_MD_FILE == 'false'
- name: Install Rust
run: |
rustup default stable
rustup target add ${{ matrix.rust }}
if: env.IS_MD_FILE == 'false'
- name: Install 32-bit tools (Linux)
run: |
sudo apt update && sudo apt install gcc-multilib -y
if: runner.os == 'Linux'
- name: Run Tests
run: cargo test --verbose --target ${{ matrix.rust }}
env:
RUST_BACKTRACE: 1
if: env.IS_MD_FILE == 'false' && runner.os == 'Linux'
- name: Run Tests (Windows)
run: cargo test --verbose --target ${{ matrix.rust }}
env:
RUST_BACKTRACE: 1
shell: cmd
if: env.IS_MD_FILE == 'false' && runner.os == 'Windows'
- name: Archive artifacts
run: |
mkdir dist
cargo build
mv target/debug/skyd target/debug/skysh target/debug/sky-bench dist
if: env.IS_MD_FILE == 'false' && runner.os == 'Linux'
- name: Archive artifacts
shell: cmd
run: |
cargo build
rm -rf dist
mkdir dist
move target\debug\*.exe dist
env:
RUSTFLAGS: -Ctarget-feature=+crt-static
if: env.IS_MD_FILE == 'false' && runner.os == 'Windows'
- name: Save artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ github.sha }}-${{ matrix.rust }}-builds.zip
path: dist
if: env.IS_MD_FILE == 'false'