Skip to content

Commit 4e21bf8

Browse files
authored
Merge pull request #1 from mintlayer/initial_implementation
Initial implementation
2 parents 0607eb1 + f5d166c commit 4e21bf8

27 files changed

+2946
-1
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @erubboli @ImplOfAnImpl @OBorce

.github/workflows/build.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Build and run tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- "**" # target all branches
10+
schedule:
11+
- cron: '15 0 * * *' # every day at 00:15 UTC
12+
13+
env:
14+
CARGO_TERM_COLOR: always
15+
RUST_LOG: debug
16+
RUST_BACKTRACE: full
17+
18+
jobs:
19+
build_ubuntu:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout the repository
23+
uses: actions/checkout@v5
24+
with:
25+
submodules: recursive
26+
27+
- name: Update the list of available system packages
28+
run: sudo apt-get update
29+
30+
- name: Install build dependencies
31+
run: sudo apt-get install -yqq --no-install-recommends build-essential
32+
33+
- name: Setup Python
34+
uses: actions/setup-python@v6
35+
with:
36+
python-version-file: './build-tools/.python-version'
37+
38+
- name: Install Rust
39+
run: |
40+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
41+
--default-toolchain $(python ./build-tools/cargo-info-extractor/extract.py --rust-version)
42+
43+
- name: Build
44+
run: cargo build --locked
45+
46+
- name: Run tests
47+
run: cargo test --all
48+
49+
- name: Run doc tests
50+
run: cargo test --doc
51+
52+
build_macos:
53+
runs-on: macos-latest
54+
steps:
55+
- name: Checkout the repository
56+
uses: actions/checkout@v5
57+
with:
58+
submodules: recursive
59+
60+
- name: Setup Python
61+
uses: actions/setup-python@v6
62+
with:
63+
python-version-file: './build-tools/.python-version'
64+
65+
- name: Install Rust
66+
run: |
67+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
68+
--default-toolchain $(python ./build-tools/cargo-info-extractor/extract.py --rust-version)
69+
70+
- name: Build
71+
run: cargo build --locked
72+
73+
- name: Run tests
74+
run: cargo test --all
75+
76+
- name: Run doc tests
77+
run: cargo test --doc
78+
79+
build_windows:
80+
runs-on: windows-latest
81+
steps:
82+
- name: Checkout the repository
83+
uses: actions/checkout@v5
84+
with:
85+
submodules: recursive
86+
87+
- name: Setup Python
88+
uses: actions/setup-python@v6
89+
with:
90+
python-version-file: './build-tools/.python-version'
91+
92+
- name: Install Rust
93+
# Use bash to be able to escape the newline via '\'.
94+
shell: bash
95+
run: |
96+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
97+
--default-toolchain $(python ./build-tools/cargo-info-extractor/extract.py --rust-version)
98+
99+
- name: Build
100+
run: cargo build --locked
101+
102+
- name: Run tests
103+
run: cargo test --all
104+
105+
- name: Run doc tests
106+
run: cargo test --doc

.github/workflows/code_checks.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Static code checks
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- "**" # target all branches
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
RUST_LOG: debug
14+
RUST_BACKTRACE: full
15+
16+
jobs:
17+
static_checks_ubuntu:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout the repository
21+
uses: actions/checkout@v5
22+
with:
23+
submodules: recursive
24+
25+
- name: Update the list of available system packages
26+
run: sudo apt-get update
27+
28+
- name: Install dependencies
29+
run: sudo apt-get install -yqq --no-install-recommends build-essential
30+
31+
- name: Setup Python
32+
uses: actions/setup-python@v6
33+
with:
34+
python-version-file: './build-tools/.python-version'
35+
36+
- name: Install Rust
37+
run: |
38+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
39+
--default-toolchain $(python ./build-tools/cargo-info-extractor/extract.py --rust-version)
40+
41+
- name: Install Clippy
42+
run: rustup component add clippy
43+
44+
- name: Install cargo-deny
45+
run: cargo install cargo-deny --locked
46+
47+
- name: Run checks
48+
run: ./do_checks.sh
49+
50+
static_checks_macos:
51+
runs-on: macos-latest
52+
steps:
53+
- name: Checkout the repository
54+
uses: actions/checkout@v5
55+
with:
56+
submodules: recursive
57+
58+
- name: Setup Python
59+
uses: actions/setup-python@v6
60+
with:
61+
python-version-file: './build-tools/.python-version'
62+
63+
- name: Install Rust
64+
run: |
65+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
66+
--default-toolchain $(python ./build-tools/cargo-info-extractor/extract.py --rust-version)
67+
68+
- name: Install Clippy
69+
run: rustup component add clippy
70+
71+
- name: Install cargo-deny
72+
run: cargo install cargo-deny --locked
73+
74+
- name: Run checks
75+
shell: bash
76+
run: ./do_checks.sh
77+
78+
static_checks_windows:
79+
runs-on: windows-latest
80+
steps:
81+
# This prevents git from changing line-endings to crlf, which messes cargo fmt checks
82+
- name: Set git to use LF
83+
run: |
84+
git config --global core.autocrlf false
85+
git config --global core.eol lf
86+
87+
- name: Checkout the repository
88+
uses: actions/checkout@v5
89+
with:
90+
submodules: recursive
91+
92+
- name: Setup Python
93+
uses: actions/setup-python@v6
94+
with:
95+
python-version-file: './build-tools/.python-version'
96+
97+
- name: Install Rust
98+
# Use bash to be able to escape the newline via '\'.
99+
shell: bash
100+
run: |
101+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
102+
--default-toolchain $(python ./build-tools/cargo-info-extractor/extract.py --rust-version)
103+
104+
- name: Install Clippy
105+
run: rustup component add clippy
106+
107+
- name: Install cargo-deny
108+
run: cargo install cargo-deny --locked
109+
110+
- name: Run checks
111+
shell: bash
112+
run: ./do_checks.sh

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/target
2+
3+
.vscode/
4+
5+
.DS_Store
6+
7+
# Python cache
8+
**/__pycache__
9+
10+
# Python compiled files
11+
*.pyc

0 commit comments

Comments
 (0)