Skip to content

Commit a6e8f64

Browse files
authored
Merge pull request #7 from tcerqueira/dev
Developement (deliverable 3)
2 parents 316e470 + d975a4e commit a6e8f64

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+6058
-673
lines changed

.cargo/config.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[build]
2+
rustflags = ["-Ctarget-cpu=native"]
3+
4+
[alias]
5+
# E.g. CARGO_PROFILE_BENCH_DEBUG=true cargo profile-bench mix_node
6+
profile-bench = "flamegraph --root --bench"
7+
profile-test = "flamegraph --root --test"

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DATABASE_URL=postgres://username:password@localhost/iris-codes

.github/workflows/audit.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
name: Security audit
22
on:
33
schedule:
4-
- cron: '0 0 * * *'
4+
- cron: "0 0 * * *"
55
push:
66
paths:
7-
- '**/Cargo.toml'
8-
- '**/Cargo.lock'
7+
- "**/Cargo.toml"
8+
- "**/Cargo.lock"
99
workflow_dispatch:
10-
branches:
11-
- master
1210

1311
jobs:
1412
security_audit:
@@ -17,4 +15,4 @@ jobs:
1715
- uses: actions/checkout@v3
1816
- uses: taiki-e/install-action@cargo-deny
1917
- name: Scan for vulnerabilities
20-
run: cargo deny check advisories
18+
run: cargo deny check advisories

.github/workflows/benchmark.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@ on:
33
push:
44
branches:
55
- master
6-
pull_request:
7-
types: [ opened, synchronize, reopened ]
8-
branches:
9-
- master
106
workflow_dispatch:
11-
branches:
12-
- master
137

148
env:
159
CARGO_TERM_COLOR: always
@@ -18,7 +12,34 @@ jobs:
1812
bench:
1913
name: Bench
2014
runs-on: ubuntu-latest
15+
services:
16+
postgres:
17+
image: postgres:16
18+
env:
19+
POSTGRES_USER: username
20+
POSTGRES_PASSWORD: password
21+
POSTGRES_DB: iris-codes
22+
ports:
23+
- 5432:5432
24+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
2125
steps:
2226
- uses: actions/checkout@v4
2327
- uses: dtolnay/rust-toolchain@stable
24-
- run: cargo bench
28+
- uses: arduino/setup-protoc@v3
29+
- uses: baptiste0928/cargo-install@v3
30+
with:
31+
crate: sqlx-cli
32+
- uses: actions/cache@v3
33+
with:
34+
path: |
35+
~/.cargo/bin/
36+
~/.cargo/registry/index/
37+
~/.cargo/registry/cache/
38+
~/.cargo/git/db/
39+
target/
40+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
41+
- name: Run migrations
42+
run: sqlx migrate run --source mix-node/migrations
43+
env:
44+
DATABASE_URL: postgres://username:password@localhost/iris-codes
45+
- run: cargo bench

.github/workflows/general.yml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ on:
44
branches:
55
- master
66
pull_request:
7-
types: [ opened, synchronize, reopened ]
7+
types: [opened, synchronize, reopened]
88
branches:
99
- master
1010
workflow_dispatch:
11-
branches:
12-
- master
1311

1412
env:
1513
CARGO_TERM_COLOR: always
@@ -18,11 +16,38 @@ jobs:
1816
test:
1917
name: Test
2018
runs-on: ubuntu-latest
19+
services:
20+
postgres:
21+
image: postgres:16
22+
env:
23+
POSTGRES_USER: username
24+
POSTGRES_PASSWORD: password
25+
POSTGRES_DB: iris-codes
26+
ports:
27+
- 5432:5432
28+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
2129
steps:
2230
- uses: actions/checkout@v4
2331
- uses: dtolnay/rust-toolchain@stable
32+
- uses: arduino/setup-protoc@v3
33+
- uses: baptiste0928/cargo-install@v3
34+
with:
35+
crate: sqlx-cli
36+
- uses: actions/cache@v3
37+
with:
38+
path: |
39+
~/.cargo/bin/
40+
~/.cargo/registry/index/
41+
~/.cargo/registry/cache/
42+
~/.cargo/git/db/
43+
target/
44+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
45+
- name: Run migrations
46+
run: sqlx migrate run --source mix-node/migrations
47+
env:
48+
DATABASE_URL: postgres://username:password@localhost/iris-codes
2449
- run: cargo test --all-features
25-
50+
2651
fmt:
2752
name: Rustfmt
2853
runs-on: ubuntu-latest
@@ -33,7 +58,7 @@ jobs:
3358
components: rustfmt
3459
- name: Enforce formatting
3560
run: cargo fmt --check
36-
61+
3762
clippy:
3863
name: Clippy
3964
runs-on: ubuntu-latest
@@ -42,5 +67,6 @@ jobs:
4267
- uses: dtolnay/rust-toolchain@stable
4368
with:
4469
components: clippy
70+
- uses: arduino/setup-protoc@v3
4571
- name: Linting
46-
run: cargo clippy -- -D warnings
72+
run: cargo clippy -- -D warnings

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
/target
2+
3+
# Profiling
4+
*flamegraph.svg
5+
*.stacks

0 commit comments

Comments
 (0)