-
Notifications
You must be signed in to change notification settings - Fork 1
133 lines (132 loc) · 4.08 KB
/
ci.yml
File metadata and controls
133 lines (132 loc) · 4.08 KB
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
126
127
128
129
130
131
132
133
# -------------------------------------------------------------------
# ------------------------------- WARNING ---------------------------
# -------------------------------------------------------------------
#
# This file was automatically generated by gh-workflows using the
# gh-workflow-gen bin. You should add and commit this file to your
# git repository. **DO NOT EDIT THIS FILE BY HAND!** Any manual changes
# will be lost if the file is regenerated.
#
# To make modifications, update your `build.rs` configuration to adjust
# the workflow description as needed, then regenerate this file to apply
# those changes.
#
# -------------------------------------------------------------------
# ----------------------------- END WARNING -------------------------
# -------------------------------------------------------------------
name: CI
'on':
pull_request:
branches:
- main
push:
branches:
- main
jobs:
fmt:
name: formatting
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v5
- name: Setup Rust Toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
components: rustfmt
cache: true
- name: Install cargo-sort
uses: taiki-e/install-action@v2
with:
tool: cargo-sort
- name: Install taplo
uses: taiki-e/install-action@v2
with:
tool: taplo
- name: Run cargo-machete
uses: bnjbvr/cargo-machete@main
- name: Run cargo-sort
run: cargo +nightly sort --workspace --grouped --check --check-format
- name: Run taplo fmt
run: taplo fmt --check --diff
- name: Run cargo fmt
run: cargo +nightly fmt --all -- --check
sqlx_offline:
name: sqlx offline
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v5
- name: Setup Rust Toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
cache: true
- name: Install native dependencies
if: runner.os == 'Linux'
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libfontconfig1-dev
- id: postgres
name: Setup PostgreSQL
uses: ikalnytskyi/action-setup-postgres@v8
with:
username: postgres
password: postgres
database: kreqo
port: '8080'
postgres-version: '18'
- name: Install sqlx-cli
uses: taiki-e/install-action@v2
with:
tool: sqlx-cli
- name: Run sqlx migrate run
run: sqlx migrate run --source server/migrations
env:
DATABASE_URL: ${{ steps.postgres.outputs.connection-uri }}
- name: Run cargo sqlx prepare
run: cargo +nightly sqlx prepare --check --workspace
env:
DATABASE_URL: ${{ steps.postgres.outputs.connection-uri }}
lint:
name: linting
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- windows-latest
- macos-latest
- ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v5
- name: Setup Rust Toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
components: clippy
cache: true
- name: Install native dependencies
if: runner.os == 'Linux'
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libfontconfig1-dev
- name: Run cargo clippy
run: cargo +nightly clippy -- -D warnings
test:
name: testing
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- windows-latest
- macos-latest
- ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v5
- name: Setup Rust Toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: true
- name: Install native dependencies
if: runner.os == 'Linux'
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libfontconfig1-dev
- name: Run cargo test
run: cargo +nightly test