name: Test (PR) on: [pull_request] env: BUILD: 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: - name: Checkout code uses: actions/checkout@v2 with: fetch-depth: 2 - name: Setup environment run: | chmod +x ci/buildvars.sh ci/buildvars.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.BUILD == 'true' - 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.BUILD == 'true' - 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.BUILD == 'true' - name: Install Rust run: | rustup update ${{ matrix.rust }} --no-self-update rustup default ${{ matrix.rust }} if: env.BUILD == 'true' - name: Run Tests run: | cargo run -p skyd -- --nosave --noart & cargo test --verbose -- --test-threads=1 sudo pkill skyd env: RUST_BACKTRACE: 1 if: env.IS_MD_FILE == 'false' && runner.os != 'Windows' - name: Run Tests (Windows) run: | cargo build -p skyd START /B target\debug\skyd.exe --nosave --noart cargo test --verbose -- --test-threads=1 env: RUST_BACKTRACE: 1 shell: cmd if: env.IS_MD_FILE == 'false' && runner.os == 'Windows'