This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (94 loc) · 2.5 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
# Sources:
# https://github.com/SeaQL/sea-orm/blob/master/.github/workflows/rust.yml
name: Fydia Builder
on:
push:
jobs:
clippy-fmt:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: rui314/setup-mold@v1
- name: Set up Clang
uses: egor-tensin/setup-clang@v1
with:
version: latest
platform: x64
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: clippy
override: true
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/cargo@v1
with:
command: clippy
args: >
--no-deps
build_fydia:
name: Build Fydia
strategy:
matrix:
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: rui314/setup-mold@v1
- name: Set up Clang
uses: egor-tensin/setup-clang@v1
with:
version: latest
platform: x64
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: Swatinem/rust-cache@v2
- name: Fydia
uses: actions-rs/cargo@v1
with:
command: build
args: -p fydia --release
- name: upload artifact
if: ${{ github.ref_name == 'main' }}
uses: actions/upload-artifact@v3
with:
name: "Linux-release"
path: "/home/runner/work/fydia/fydia/target/release/fydia"
- name: Fydia
uses: actions-rs/cargo@v1
with:
command: build
args: -p fydia --release --features=sample
- run: |
mkdir test-env
cd test-env
echo '[instance]
domain = ""
[server]
ip = "0.0.0.0"
port = 8080
[database]
database_type = "Sqlite"
ip = "fydia_test"
port = 3306
name = ""
password = ""
database_name = "Fydia"' >> config.toml
chmod +x ../target/release/fydia
../target/release/fydia &
cd ..
cargo test -p fydia-test
killall fydia
delete-artifacts:
needs: [build_fydia]
runs-on: ubuntu-latest
if: ${{ github.ref_name == 'main' }}
steps:
- uses: kolpav/purge-artifacts-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
expire-in: 1hr