Rocket/.github/workflows/ci.yml

88 lines
2.9 KiB
YAML
Raw Normal View History

name: CI
2020-07-11 19:56:33 +00:00
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
2020-07-11 19:56:33 +00:00
jobs:
test:
name: "${{ matrix.platform.name }} ${{ matrix.test.name }} (${{ matrix.platform.toolchain }})"
2020-07-11 19:56:33 +00:00
strategy:
fail-fast: false
2020-07-11 19:56:33 +00:00
matrix:
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 }
2020-07-11 19:56:33 +00:00
test:
- { name: Debug, flag: }
- { name: Contrib, flag: "--contrib" }
- { name: Examples, flag: "--examples" }
include:
2021-07-01 03:53:59 +00:00
- 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" }
runs-on: ${{ matrix.platform.distro }}
2020-07-11 19:56:33 +00:00
continue-on-error: ${{ matrix.platform.name == 'Linux'
&& matrix.platform.toolchain == 'nightly'
&& matrix.test.name == 'Debug' }}
2020-07-11 19:56:33 +00:00
steps:
- name: Checkout Sources
uses: actions/checkout@v2
- name: Install Native Dependencies (macOS)
if: matrix.platform.name == 'macOS'
2020-07-11 19:56:33 +00:00
run: |
brew install mysql-client libpq sqlite coreutils
echo "/usr/local/opt/mysql-client/bin" >> "$GITHUB_PATH"
2020-07-11 19:56:33 +00:00
# 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'
2020-07-11 19:56:33 +00:00
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"
2020-07-11 19:56:33 +00:00
- name: Install Native Dependencies (Linux)
if: matrix.platform.name == 'Linux'
2020-07-11 19:56:33 +00:00
run: |
2021-05-09 05:01:26 +00:00
sudo apt-get update
sudo apt-get install -y libmysqlclient-dev libpq-dev libsqlite3-dev
2020-07-11 19:56:33 +00:00
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.platform.toolchain }}
2020-07-11 19:56:33 +00:00
override: true
- name: Cache Example Workspace
if: matrix.test.name == 'Examples'
uses: Swatinem/rust-cache@v1
with:
working-directory: "examples"
- name: Cache Root Workspace
if: matrix.test.name != 'Examples'
uses: Swatinem/rust-cache@v1
with:
key: ${{ matrix.test.name }}
2020-07-11 19:56:33 +00:00
- name: Run Tests
run: ./scripts/test.sh ${{ matrix.test.flag }} -q
2020-07-11 19:56:33 +00:00
shell: bash