Skip to content

Commit 6f1f9f2

Browse files
committed
fix: build with warnings as errors
1 parent 90e4dbe commit 6f1f9f2

File tree

8 files changed

+27
-39
lines changed

8 files changed

+27
-39
lines changed

.github/workflows/tests.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,23 @@ permissions:
1212
contents: read
1313

1414
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Rust toolchain
22+
uses: actions-rs/toolchain@v1
23+
with:
24+
toolchain: stable
25+
override: true
26+
27+
- name: Build with warnings as errors
28+
run: cargo build --all-targets
29+
env:
30+
RUSTFLAGS: "-D warnings"
31+
1532
lint:
1633
runs-on: ubuntu-latest
1734
steps:

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
build-operator:
44
DOCKER_BUILDKIT=1 docker build -t infraweave-operator -f operator/Dockerfile .
55

6-
unit-tests:
6+
build-check:
7+
@echo "Building with warnings as errors..."
8+
RUSTFLAGS="-D warnings" cargo build --all-targets
9+
10+
unit-tests: build-check
711
cargo test --workspace --exclude integration-tests
812

913
integration-tests: aws-integration-tests azure-integration-tests

defs/src/gitprovider.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ pub enum ExtraData {
9898
None,
9999
}
100100

101-
#[derive(Serialize, Deserialize, Clone, Debug)]
102-
pub struct None {}
103-
104101
#[derive(Serialize, Deserialize, Clone, Debug)]
105102
pub struct GitLabCheckRun {
106103
pub project: GitLabProject,

defs/src/hcl.rs

Lines changed: 0 additions & 25 deletions
This file was deleted.

defs/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ mod environment;
44
mod errors;
55
mod event;
66
mod gitprovider;
7-
mod hcl;
87
mod infra;
98
mod infra_change_record;
109
mod log;

defs/src/module.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,3 @@ pub struct Metadata {
213213
pub name: String,
214214
// pub group: String,
215215
}
216-
217-
#[derive(Debug, Serialize, Deserialize, Clone)]
218-
pub struct Output {
219-
// This struct is added to match the outputs array
220-
pub name: String,
221-
// #[serde(rename = "type")]
222-
// pub type_: String,
223-
}

operator/src/webhook.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use crate::validation::validate_claim;
1616
/// Kubernetes AdmissionReview request structure
1717
#[derive(Debug, Deserialize)]
1818
#[serde(rename_all = "camelCase")]
19+
#[allow(dead_code)]
1920
pub struct AdmissionReview {
2021
pub api_version: String,
2122
pub kind: String,
@@ -24,6 +25,7 @@ pub struct AdmissionReview {
2425

2526
#[derive(Debug, Deserialize)]
2627
#[serde(rename_all = "camelCase")]
28+
#[allow(dead_code)]
2729
pub struct AdmissionRequest {
2830
pub uid: String,
2931
pub kind: GroupVersionKind,
@@ -34,6 +36,7 @@ pub struct AdmissionRequest {
3436

3537
#[derive(Debug, Deserialize)]
3638
#[serde(rename_all = "camelCase")]
39+
#[allow(dead_code)]
3740
pub struct GroupVersionKind {
3841
pub group: String,
3942
pub version: String,
@@ -42,6 +45,7 @@ pub struct GroupVersionKind {
4245

4346
#[derive(Debug, Deserialize)]
4447
#[serde(rename_all = "camelCase")]
48+
#[allow(dead_code)]
4549
pub struct GroupVersionResource {
4650
pub group: String,
4751
pub version: String,

terraform_runner/src/runner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ async fn get_current_job_id(
357357
fn initiate_deployment_status_handler(
358358
initial_deployment: Option<DeploymentResp>,
359359
payload_with_variables: &ApiInfraPayloadWithVariables,
360-
) -> DeploymentStatusHandler {
360+
) -> DeploymentStatusHandler<'_> {
361361
let payload = &payload_with_variables.payload;
362362
let command = &payload.command;
363363
let environment = &payload.environment;

0 commit comments

Comments
 (0)