-
Notifications
You must be signed in to change notification settings - Fork 2
84 lines (74 loc) · 3.01 KB
/
build.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
name: Build
on:
push:
branches-ignore:
- gh-readonly-queue/**
pull_request:
merge_group:
jobs:
build-cmake:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Prepare Linux
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update -y
sudo apt-get install rustc cargo postfix mailutils -y
- name: Prepare Linux (mysql & email)
if: ${{ contains(matrix.os, 'ubuntu') && !matrix.fancy }}
run: |
sudo touch /etc/aliases
sudo bash -c 'echo "test: root" >> /etc/aliases'
sudo bash -c 'echo "test2: root" >> /etc/aliases'
sudo postalias /etc/aliases
sudo apt-get install libmariadb-dev mariadb-server -y
sudo mysql <<EOF
CREATE USER 'ddnet-account-test'@localhost IDENTIFIED BY 'test';
CREATE DATABASE ddnet_account_test;
GRANT ALL PRIVILEGES ON ddnet_account_test.* TO 'ddnet-account-test'@localhost;
FLUSH PRIVILEGES;
EOF
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Build in debug mode
run: |
cargo build -p ddnet-account-client
cargo build -p ddnet-account-game-server
cargo build -p ddnet-account-game-server --no-default-features --features sqlite
cargo build -p ddnet-account-game-server --no-default-features --features sqlite,mysql
cargo build -p ddnet-accounts-shared
cargo build -p ddnet-account-sql
cargo build -p ddnet-account-sql --no-default-features --features sqlite
cargo build -p ddnet-account-sql --no-default-features --features sqlite,mysql
cargo build -p ddnet-accounts-types
cargo build -p ddnet-account-client-http-fs
cargo build -p ddnet-account-client-reqwest
cargo build
- name: Test debug
run: |
cargo test -- --test-threads=1
- name: Build in release mode
run: |
cargo build -p ddnet-account-client --release
cargo build -p ddnet-account-game-server --release
cargo build -p ddnet-account-game-server --release --no-default-features --features sqlite
cargo build -p ddnet-account-game-server --release --no-default-features --features sqlite,mysql
cargo build -p ddnet-accounts-shared --release
cargo build -p ddnet-account-sql --release
cargo build -p ddnet-account-sql --release --no-default-features --features sqlite
cargo build -p ddnet-account-sql --release --no-default-features --features sqlite,mysql
cargo build -p ddnet-accounts-types --release
cargo build -p ddnet-account-client-http-fs --release
cargo build -p ddnet-account-client-reqwest --release
cargo build --release
- name: Test release
run: |
cargo test --release -p ddnet-accounts -- --test-threads=1
cargo test --release -p ddnet-account-game-server --features sqlite -- --test-threads=1