From 4cdb5047ca6b7b872d801d2ff6b0c53df6d3dbcf Mon Sep 17 00:00:00 2001 From: Namu Date: Thu, 2 Apr 2026 10:52:16 +0200 Subject: [PATCH] chore: Add CI --- .gitea/workflows/basic-pipeline.yml | 51 +++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .gitea/workflows/basic-pipeline.yml diff --git a/.gitea/workflows/basic-pipeline.yml b/.gitea/workflows/basic-pipeline.yml new file mode 100644 index 0000000..32a3445 --- /dev/null +++ b/.gitea/workflows/basic-pipeline.yml @@ -0,0 +1,51 @@ +name: Build project + +# run automatically when a push or pull request is triggered +on: [push, pull_request] + +jobs: + build: + name: quality-and-build + runs-on: ubuntu-latest + env: + # Limit to 1 job for my little VPS + CARGO_BUILD_JOBS: 1 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + components: rustfmt, clippy + + - name: Lint with Clippy + run: cargo clippy -- -D warnings + + - name: Run build (Debug mode) + run: cargo build + + + sonarqube: + needs: build + name: SonarQube Trigger + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Download SonarQube Scanner + run: | + curl -sSLo sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip + unzip sonar-scanner.zip + + - name: Run SonarQube Scan + run: | + ./sonar-scanner-*/bin/sonar-scanner \ + -Dsonar.projectKey=UdpSocketServer \ + -Dsonar.sources=. \ + -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} \ + -Dsonar.login=${{ secrets.SONARQUBE_TOKEN }}