From bee4f726746470b37adfe2cd1bb053ed0f8e4c2c Mon Sep 17 00:00:00 2001 From: Javier Roman Date: Sun, 8 Dec 2024 12:34:53 +0100 Subject: [PATCH] Add GitHub workflow --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ .trunk/trunk.yaml | 1 + tests/test_config.rs | 2 +- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..333889b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +name: CI Pipeline + +permissions: + contents: read + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Rust + uses: actions-rs/toolchain@v1.0.7 + with: + toolchain: stable + profile: minimal + override: true + + - name: Build project + run: cargo build --verbose + + - name: Run tests + run: cargo test --verbose diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index ffec96d..64b5216 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -17,6 +17,7 @@ runtimes: # This is the section where you manage your linters. (https://docs.trunk.io/check/configuration) lint: enabled: + - actionlint@1.7.4 - checkov@3.2.292 - clippy@1.65.0 - git-diff-check diff --git a/tests/test_config.rs b/tests/test_config.rs index 1886850..0fe91ef 100644 --- a/tests/test_config.rs +++ b/tests/test_config.rs @@ -30,7 +30,7 @@ fn test_load_config_env() { fn test_load_config_default() { let config = load_config(Option::None); assert_eq!(config.network.url(), "ws://localhost:8545"); - assert_eq!(config.subscriptions.len(), 2); + assert_eq!(config.subscriptions.len(), 4); assert_eq!( config.subscriptions[0].contract_address, Address::from_str("0x061b3e39A7f08F739641D31b9aD5795B3a34159f").unwrap()