Rocket/.github/workflows/ci.yml
Sergio Benitez ca4b38c0d0 Allow UI tests to fail in CI.
This commit makes passing compile UI tests optional, allowing the CI to
succeed even when UI tests fail. This change was made because UI tests
are highly susceptible to false negatives due to benign rustc compiler
output changes. A failure resulting from such a benign change inhibits
progress in the main branch due to failing PR testing which would have
otherwise passed.
2023-01-30 16:06:18 -08:00

92 lines
3.2 KiB
YAML

name: CI
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: "${{ matrix.platform.name }} ${{ matrix.test.name }} (${{ matrix.platform.toolchain }})"
runs-on: ${{ matrix.platform.distro }}
strategy:
fail-fast: false
matrix:
fallible: [false]
platform:
- { name: Linux, distro: ubuntu-latest, toolchain: stable }
- { name: Windows, distro: windows-latest, toolchain: stable }
- { name: macOS, distro: macOS-latest, toolchain: stable }
- { name: Linux, distro: ubuntu-latest, toolchain: nightly }
test:
- { name: Debug, flag: }
- { name: Contrib, flag: "--contrib" }
- { name: Examples, flag: "--examples" }
include:
- platform: { name: Linux, distro: ubuntu-latest, toolchain: nightly }
test: { name: Core, flag: "--core" }
- platform: { name: Linux, distro: ubuntu-latest, toolchain: stable }
test: { name: Release, flag: "--release" }
- platform: { name: Linux, distro: ubuntu-latest, toolchain: stable }
test: { name: UI, flag: "--ui" }
fallible: true
- platform: { name: Linux, distro: ubuntu-latest, toolchain: nightly }
test: { name: UI, flag: "--ui" }
fallible: true
steps:
- name: Checkout Sources
uses: actions/checkout@v2
- name: Install Native Dependencies (macOS)
if: matrix.platform.name == 'macOS'
run: |
brew install mysql-client libpq sqlite coreutils
echo "/usr/local/opt/mysql-client/bin" >> "$GITHUB_PATH"
# vcpkg --triplet x64-windows install libmysql libpq sqlite3 openssl
# + vcpkg/installed/vcpkg (in particular, the status file)
- name: Install Native Dependencies (Windows)
if: matrix.platform.name == 'Windows'
run: |
curl -fsS -o vcpkg.7z https://rocket.rs/static/vcpkg-2019-07-05.7z
7z x vcpkg.7z -y -bb0
xcopy .\vcpkg $env:VCPKG_INSTALLATION_ROOT /s /e /h /y /q
vcpkg integrate install
echo "VCPKGRS_DYNAMIC=1" >> "$env:GITHUB_ENV"
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" >> "$env:GITHUB_ENV"
echo "$env:VCPKG_INSTALLATION_ROOT\installed\x64-windows\lib" >> "$env:GITHUB_PATH"
- name: Install Native Dependencies (Linux)
if: matrix.platform.name == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libmysqlclient-dev libpq-dev libsqlite3-dev
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.platform.toolchain }}
override: true
components: rust-src
- name: Cache Example Workspace
if: matrix.test.name == 'Examples'
uses: Swatinem/rust-cache@v2
with:
workspaces: examples
key: ${{ matrix.test.name }}
- name: Cache Root Workspace
if: matrix.test.name != 'Examples'
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.test.name }}
- name: Run Tests
continue-on-error: ${{ matrix.fallible }}
run: ./scripts/test.sh ${{ matrix.test.flag }} -q
shell: bash