Skip to content

Commit 326f225

Browse files
committed
i most definetly got this first try and did not git reset ~8
1 parent 289e743 commit 326f225

File tree

2 files changed

+91
-64
lines changed

2 files changed

+91
-64
lines changed

.github/workflows/build.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build Artifacts
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
10+
jobs:
11+
build:
12+
name: Build project
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
include:
17+
- os: macos-14
18+
target: aarch64-apple-darwin
19+
executable: target/aarch64-apple-darwin/release/ferrumc
20+
upload_path: target/aarch64-apple-darwin/release/ferrumc
21+
- os: ubuntu-latest
22+
target: x86_64-unknown-linux-gnu
23+
executable: target/x86_64-unknown-linux-gnu/release/ferrumc
24+
upload_path: target/x86_64-unknown-linux-gnu/release/ferrumc
25+
- os: windows-latest
26+
target: x86_64-pc-windows-msvc
27+
executable: target/x86_64-pc-windows-msvc/release/ferrumc.exe
28+
upload_path: target/x86_64-pc-windows-msvc/release/ferrumc.exe
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
34+
- name: Cache dependencies
35+
uses: actions/cache@v3
36+
with:
37+
path: |
38+
~/.cargo/registry
39+
~/.cargo/git
40+
target
41+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
42+
restore-keys: |
43+
${{ runner.os }}-cargo-
44+
45+
- name: Install Rust nightly
46+
uses: dtolnay/rust-toolchain@nightly
47+
with:
48+
targets: ${{ matrix.target }}
49+
50+
- name: Build
51+
run: cargo build --release --target ${{ matrix.target }} --verbose
52+
53+
- name: Upload build artifacts
54+
uses: actions/upload-artifact@v3
55+
with:
56+
name: build-artifacts-${{ matrix.os }}
57+
path: ${{ matrix.upload_path }}

.github/workflows/rust.yml

+34-64
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,66 @@
1-
name: Rust
2-
1+
name: Rust CI
32
on:
43
pull_request:
54
branches: [ "master", "rewrite/v3" ]
65
push:
76
branches: [ "master", "rewrite/v3" ]
87
workflow_dispatch:
9-
108
env:
119
CARGO_TERM_COLOR: always
12-
10+
defaults:
11+
run:
12+
shell: bash
1313
jobs:
1414
format:
15-
name: Check code formatting
15+
name: Check Code Formatting
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout repository
1919
uses: actions/checkout@v4
20-
20+
- name: Cache dependencies
21+
uses: actions/cache@v3
22+
with:
23+
path: |
24+
~/.cargo/registry
25+
~/.cargo/git
26+
target
27+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
28+
restore-keys: |
29+
${{ runner.os }}-cargo-
2130
- name: Install Rust nightly
2231
uses: dtolnay/rust-toolchain@nightly
23-
24-
- name: Install rustfmt
25-
run: rustup component add rustfmt
26-
32+
with:
33+
components: rustfmt
2734
- name: Run cargo fmt
2835
run: cargo fmt --all -- --check
29-
3036
clippy:
3137
name: Run Clippy
3238
runs-on: ubuntu-latest
3339
steps:
3440
- name: Checkout repository
3541
uses: actions/checkout@v4
36-
37-
- name: Restore cargo cache
42+
- name: Cache dependencies
3843
uses: actions/cache@v3
3944
with:
4045
path: |
4146
~/.cargo/registry
4247
~/.cargo/git
48+
target
4349
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
4450
restore-keys: |
4551
${{ runner.os }}-cargo-
46-
4752
- name: Install Rust nightly
4853
uses: dtolnay/rust-toolchain@nightly
49-
50-
- name: Install clippy
51-
run: rustup component add clippy
52-
54+
with:
55+
components: clippy
5356
- name: Run Clippy
54-
run: cargo clippy --all-targets -- -Dwarnings
55-
57+
run: cargo clippy --all-targets -- -D warnings
5658
security:
57-
name: Check for security vulnerabilities
59+
name: Check Security Vulnerabilities
5860
runs-on: ubuntu-latest
5961
steps:
6062
- name: Checkout repository
6163
uses: actions/checkout@v4
62-
63-
- name: Install Rust nightly
64-
uses: dtolnay/rust-toolchain@nightly
65-
66-
- name: Install audit
67-
run: cargo install cargo-audit
68-
69-
- name: Run cargo audit
70-
run: cargo install cargo-audit && cargo audit
71-
72-
build:
73-
name: Build project
74-
runs-on: ${{ matrix.os }}
75-
strategy:
76-
matrix:
77-
include:
78-
- os: macos-14
79-
target: aarch64-apple-darwin
80-
- os: ubuntu-latest
81-
target: x86_64-unknown-linux-gnu
82-
- os: windows-latest
83-
target: x86_64-pc-windows-msvc
84-
85-
steps:
86-
- name: Checkout repository
87-
uses: actions/checkout@v4
88-
8964
- name: Cache dependencies
9065
uses: actions/cache@v3
9166
with:
@@ -96,17 +71,16 @@ jobs:
9671
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
9772
restore-keys: |
9873
${{ runner.os }}-cargo-
99-
10074
- name: Install Rust nightly
10175
uses: dtolnay/rust-toolchain@nightly
102-
with:
103-
targets: ${{ matrix.target }}
104-
105-
- name: Build
106-
run: cargo build --release --target ${{ matrix.target }} --verbose
107-
76+
- name: Install and Run Cargo Audit
77+
run: |
78+
if ! command -v cargo-audit &> /dev/null; then
79+
cargo install cargo-audit
80+
fi
81+
cargo audit
10882
test:
109-
name: Run tests
83+
name: Run Tests
11084
runs-on: ${{ matrix.os }}
11185
strategy:
11286
matrix:
@@ -117,26 +91,22 @@ jobs:
11791
target: x86_64-unknown-linux-gnu
11892
- os: windows-latest
11993
target: x86_64-pc-windows-msvc
120-
12194
steps:
12295
- name: Checkout repository
12396
uses: actions/checkout@v4
124-
12597
- name: Cache dependencies
12698
uses: actions/cache@v3
12799
with:
128100
path: |
129101
~/.cargo/registry
130102
~/.cargo/git
131103
target
132-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
104+
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
133105
restore-keys: |
134-
${{ runner.os }}-cargo-
135-
106+
${{ matrix.os }}-cargo-
136107
- name: Install Rust nightly
137108
uses: dtolnay/rust-toolchain@nightly
138109
with:
139110
targets: ${{ matrix.target }}
140-
141-
- name: Run tests
142-
run: cargo test --target ${{ matrix.target }} --verbose
111+
- name: Run Tests
112+
run: cargo test --target ${{ matrix.target }} --verbose

0 commit comments

Comments
 (0)