-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding basic Rust CI infrastructure (#1)
* Placeholder crates to start working on infra * More example infrastructure * Add basic CI for Rust * Fix formatting of yaml * Add manual dispatch to workflow * Use checkout v3 * Update and simplify * Switch to warnings for clippy::pedantic for easier local development
- Loading branch information
Showing
16 changed files
with
485 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: CI Build and Test | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
format: | ||
name: Format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: "true" | ||
- name: Check Formatting | ||
run: cargo fmt -v --all -- --check | ||
|
||
build: | ||
name: CI Build and Test | ||
strategy: | ||
matrix: | ||
os: [windows-latest, ubuntu-latest, macos-latest] | ||
|
||
runs-on: ${{matrix.os}} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: "true" | ||
- name: Clippy Lints | ||
run: cargo clippy -vv --all-targets --all-features -- -D warnings | ||
- name: Build | ||
run: cargo build -vv --release | ||
- name: Test | ||
run: cargo test -vv --release -- --nocapture | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{matrix.os}} | ||
path: | | ||
target/release/qsc* | ||
!target/release/qsc.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[workspace] | ||
members = [ | ||
"compiler/qsc", | ||
"compiler/qsc_ast", | ||
"compiler/qsc_codegen", | ||
"compiler/qsc_eval", | ||
"compiler/qsc_frontend", | ||
"compiler/qsc_passes", | ||
] | ||
|
||
[profile.release] | ||
debug = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[package] | ||
name = "qsc" | ||
version = "0.0.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
qsc_ast = { path = "../qsc_ast" } | ||
qsc_frontend = { path = "../qsc_frontend" } | ||
qsc_passes = { path = "../qsc_passes" } | ||
qsc_codegen = { path = "../qsc_codegen" } | ||
qsc_eval = { path = "../qsc_eval" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
#![warn(clippy::pedantic)] | ||
|
||
fn main() { | ||
println!("Hello, world!"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "qsc_ast" | ||
version = "0.0.0" | ||
edition = "2021" | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
#![warn(clippy::pedantic)] | ||
|
||
#[must_use] | ||
pub fn add(left: usize, right: usize) -> usize { | ||
left + right | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
#[test] | ||
fn it_works() { | ||
let result = add(2, 2); | ||
assert_eq!(result, 4); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = "qsc_codegen" | ||
version = "0.0.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
qsc_ast = { path = "../qsc_ast" } | ||
qsc_frontend = { path = "../qsc_frontend" } | ||
# LLVM dependency here... |
Oops, something went wrong.