2020-07-17 14:36:38 +00:00
|
|
|
name: CI
|
2020-07-11 19:56:33 +00:00
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
2021-03-10 00:13:03 +00:00
|
|
|
name: "${{ matrix.platform.name }} ${{ matrix.test.name }} (${{ matrix.platform.toolchain }})"
|
2023-01-30 22:15:24 +00:00
|
|
|
runs-on: ${{ matrix.platform.distro }}
|
2020-07-11 19:56:33 +00:00
|
|
|
|
|
|
|
strategy:
|
2020-07-17 14:36:38 +00:00
|
|
|
fail-fast: false
|
2020-07-11 19:56:33 +00:00
|
|
|
matrix:
|
2021-03-10 00:13:03 +00:00
|
|
|
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:
|
2024-04-12 01:27:43 +00:00
|
|
|
- { name: Debug }
|
2021-03-09 23:32:04 +00:00
|
|
|
- { name: Examples, flag: "--examples" }
|
2024-04-12 01:27:43 +00:00
|
|
|
- { name: Contrib, flag: "--contrib" }
|
2020-07-17 14:36:38 +00:00
|
|
|
include:
|
2024-04-12 01:27:43 +00:00
|
|
|
# Additional tests on Linux/stable.
|
|
|
|
- platform: { name: Linux, distro: ubuntu-latest, toolchain: stable }
|
2020-07-17 14:36:38 +00:00
|
|
|
test: { name: Core, flag: "--core" }
|
2021-03-10 00:13:03 +00:00
|
|
|
- platform: { name: Linux, distro: ubuntu-latest, toolchain: stable }
|
2020-07-17 14:36:38 +00:00
|
|
|
test: { name: Release, flag: "--release" }
|
2023-01-30 22:15:24 +00:00
|
|
|
- platform: { name: Linux, distro: ubuntu-latest, toolchain: stable }
|
|
|
|
test: { name: UI, flag: "--ui" }
|
|
|
|
fallible: true
|
2024-04-12 01:27:43 +00:00
|
|
|
# Allow tests on nightly to fail.
|
|
|
|
- platform: { toolchain: nightly }
|
2023-01-30 22:15:24 +00:00
|
|
|
fallible: true
|
2024-04-12 01:27:43 +00:00
|
|
|
# Use the bigger 'C:/' from the "Switch Disk" step
|
2023-04-03 19:18:09 +00:00
|
|
|
- platform: { name: Windows }
|
2024-04-12 01:27:43 +00:00
|
|
|
working-directory:
|
|
|
|
"C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}"
|
2020-07-11 19:56:33 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout Sources
|
2024-04-12 01:27:43 +00:00
|
|
|
uses: actions/checkout@v4
|
2020-07-11 19:56:33 +00:00
|
|
|
|
2023-04-03 19:18:09 +00:00
|
|
|
- name: Free Disk Space (Linux)
|
2023-03-25 14:43:54 +00:00
|
|
|
if: matrix.platform.name == 'Linux'
|
|
|
|
run: |
|
|
|
|
echo "Freeing up disk space on Linux CI"
|
|
|
|
df -h
|
|
|
|
sudo rm -rf /usr/share/dotnet/
|
|
|
|
sudo rm -rf /opt/ghc
|
|
|
|
sudo rm -rf /usr/local/share/boost
|
|
|
|
sudo rm -rf /usr/local/graalvm/
|
|
|
|
sudo rm -rf /usr/local/.ghcup/
|
|
|
|
sudo rm -rf /usr/local/share/powershell
|
|
|
|
sudo rm -rf /usr/local/share/chromium
|
|
|
|
sudo rm -rf /usr/local/lib/android
|
|
|
|
sudo rm -rf /usr/local/lib/node_modules
|
|
|
|
df -h
|
|
|
|
|
2020-07-11 19:56:33 +00:00
|
|
|
- name: Install Native Dependencies (macOS)
|
2021-03-10 00:13:03 +00:00
|
|
|
if: matrix.platform.name == 'macOS'
|
2020-07-11 19:56:33 +00:00
|
|
|
run: |
|
|
|
|
brew install mysql-client libpq sqlite coreutils
|
2024-05-02 08:28:45 +00:00
|
|
|
brew link --force --overwrite mysql-client
|
|
|
|
brew link --force --overwrite libpq
|
2020-11-18 16:56:41 +00:00
|
|
|
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)
|
2021-03-10 00:13:03 +00:00
|
|
|
if: matrix.platform.name == 'Windows'
|
2020-07-11 19:56:33 +00:00
|
|
|
run: |
|
2024-03-05 02:28:47 +00:00
|
|
|
curl -fsLS -o vcpkg.7z https://blob.rocket.rs/vcpkg-2019-07-05.7z
|
2020-07-11 19:56:33 +00:00
|
|
|
7z x vcpkg.7z -y -bb0
|
|
|
|
xcopy .\vcpkg $env:VCPKG_INSTALLATION_ROOT /s /e /h /y /q
|
|
|
|
vcpkg integrate install
|
2020-11-18 16:56:41 +00:00
|
|
|
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)
|
2021-03-10 00:13:03 +00:00
|
|
|
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
|
2023-01-31 19:40:22 +00:00
|
|
|
uses: dtolnay/rust-toolchain@master
|
|
|
|
id: toolchain
|
2020-07-11 19:56:33 +00:00
|
|
|
with:
|
2021-03-10 00:13:03 +00:00
|
|
|
toolchain: ${{ matrix.platform.toolchain }}
|
2022-07-14 01:52:37 +00:00
|
|
|
components: rust-src
|
2020-07-11 19:56:33 +00:00
|
|
|
|
2021-03-10 00:13:03 +00:00
|
|
|
- name: Cache Example Workspace
|
|
|
|
if: matrix.test.name == 'Examples'
|
2022-08-05 01:40:33 +00:00
|
|
|
uses: Swatinem/rust-cache@v2
|
2021-03-10 00:13:03 +00:00
|
|
|
with:
|
2022-08-05 01:40:33 +00:00
|
|
|
workspaces: examples
|
2023-01-31 19:40:22 +00:00
|
|
|
key: ${{ matrix.test.name }}-${{ steps.toolchain.outputs.cachekey }}
|
2021-03-10 00:13:03 +00:00
|
|
|
|
|
|
|
- name: Cache Root Workspace
|
|
|
|
if: matrix.test.name != 'Examples'
|
2022-08-05 01:40:33 +00:00
|
|
|
uses: Swatinem/rust-cache@v2
|
2021-03-10 00:13:03 +00:00
|
|
|
with:
|
2023-01-31 19:40:22 +00:00
|
|
|
key: ${{ matrix.test.name }}-${{ steps.toolchain.outputs.cachekey }}
|
2021-03-10 00:13:03 +00:00
|
|
|
|
2023-04-03 19:18:09 +00:00
|
|
|
# Don't run out of disk space on Windows. C: has much much space than D:.
|
|
|
|
- name: Switch Disk (Windows)
|
|
|
|
if: matrix.platform.name == 'Windows'
|
|
|
|
run: |
|
|
|
|
Get-PSDrive
|
|
|
|
cp D:\a C:\ -Recurse
|
|
|
|
Get-PSDrive
|
|
|
|
|
2020-07-11 19:56:33 +00:00
|
|
|
- name: Run Tests
|
2024-04-12 01:27:43 +00:00
|
|
|
continue-on-error: ${{ matrix.fallible || false }}
|
2023-04-03 19:18:09 +00:00
|
|
|
working-directory: ${{ matrix.working-directory || github.workspace }}
|
2024-04-12 01:27:43 +00:00
|
|
|
run: ./scripts/test.sh ${{ matrix.test.flag || '' }} -q
|
2020-07-11 19:56:33 +00:00
|
|
|
shell: bash
|