-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
125 lines (111 loc) · 4.74 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
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:
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 }
- { name: Examples, flag: "--examples" }
- { name: Contrib, flag: "--contrib" }
include:
# Additional tests on Linux/stable.
- platform: { name: Linux, distro: ubuntu-latest, toolchain: stable }
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: Testbench, flag: "--testbench" }
- platform: { name: Linux, distro: ubuntu-latest, toolchain: stable }
test: { name: UI, flag: "--ui" }
fallible: true
# Allow tests on nightly to fail.
- platform: { toolchain: nightly }
fallible: true
# Use the bigger 'C:/' from the "Switch Disk" step
- platform: { name: Windows }
working-directory:
"C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}"
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Free Disk Space (Linux)
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
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo docker image prune --all --force
df -h
- name: Install Native Dependencies (macOS)
if: matrix.platform.name == 'macOS'
run: |
brew install mysql-client libpq sqlite coreutils
brew link --force --overwrite mysql-client
brew link --force --overwrite libpq
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 -fsLS -o vcpkg.7z https://blob.rocket.rs/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: dtolnay/rust-toolchain@master
id: toolchain
with:
toolchain: ${{ matrix.platform.toolchain }}
components: rust-src
- name: Cache Example Workspace
if: matrix.test.name == 'Examples'
uses: Swatinem/rust-cache@v2
with:
workspaces: examples
key: ${{ matrix.test.name }}-${{ steps.toolchain.outputs.cachekey }}
- name: Cache Root Workspace
if: matrix.test.name != 'Examples'
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.test.name }}-${{ steps.toolchain.outputs.cachekey }}
# 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
- name: Run Tests
continue-on-error: ${{ matrix.fallible || false }}
working-directory: ${{ matrix.working-directory || github.workspace }}
run: ./scripts/test.sh ${{ matrix.test.flag || '' }} -q
shell: bash