Skip to content

Commit

Permalink
Add Rust QA to the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
denisonbarbosa committed Sep 19, 2023
1 parent 4d204a5 commit c34f978
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
40 changes: 36 additions & 4 deletions .github/workflows/qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ env:
libpam0g-dev
jobs:
sanity:
name: Code sanity
go-sanity:
name: "Go: Code sanity"
runs-on: ubuntu-latest
steps:
- name: Install dependencies
Expand All @@ -27,8 +27,38 @@ jobs:
golangci-lint-configfile: ".golangci.yaml"
tools-directory: "tools"

tests:
name: Tests
rust-sanity:
name: "Rust: Code sanity"
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo DEBIAN_FRONTEND=noninteractive apt update
sudo DEBIAN_FRONTEND=noninteractive apt install -y ${{ env.apt_deps }} protobuf-compiler protobuf-compiler-grpc
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Build crate
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features
- name: Check code format with rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
- name: Check code format with clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features

go-tests:
name: "Go: Tests"
runs-on: ubuntu-latest
steps:
- name: Install dependencies
Expand All @@ -51,3 +81,5 @@ jobs:
uses: codecov/codecov-action@v3
with:
file: /tmp/coverage.combined

# TODO: rust-tests:
1 change: 1 addition & 0 deletions nss/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
tonic_build::configure()
.build_server(false)
.protoc_arg("--experimental_allow_proto3_optional")
.compile(&["../authd.proto"], &["../"])?;
Ok(())
}

0 comments on commit c34f978

Please sign in to comment.