From b71618e2e19547c182266f9ebf322937d6905e04 Mon Sep 17 00:00:00 2001 From: nyyu Date: Mon, 24 Jun 2024 17:42:14 +0200 Subject: [PATCH] chore(sonar): tune branch analyze --- .woodpecker/.linux.yml | 14 +++++++++----- .woodpecker/.mingw.yml | 15 +++++++++------ .woodpecker/.test.yml | 41 ++++++++++++++++++++++++++++++++++++++++ sonar-project.properties | 5 +++++ 4 files changed, 64 insertions(+), 11 deletions(-) create mode 100644 .woodpecker/.test.yml create mode 100644 sonar-project.properties diff --git a/.woodpecker/.linux.yml b/.woodpecker/.linux.yml index 9d28c30..a95b214 100644 --- a/.woodpecker/.linux.yml +++ b/.woodpecker/.linux.yml @@ -10,11 +10,15 @@ steps: - cargo build --release - strip target/release/cggitem_sets when: - path: - include: ['.woodpecker/*.yml', 'src/*', 'Cargo*'] - event: [push, pull_request, manual, tag] +# path: +# include: ['.woodpecker/*.yml', 'src/*', 'Cargo*'] + - event: [manual, tag] + - event: push + branch: renovate/* + - event: push + branch: ${CI_REPO_DEFAULT_BRANCH} deploy: - image: alpine:latest + image: alpine:3.20 pull: true commands: - apk add --no-cache curl @@ -25,4 +29,4 @@ steps: include: ['.woodpecker/*.yml', 'src/*', 'Cargo*'] event: [push, manual, tag] branch: - - master + - ${CI_REPO_DEFAULT_BRANCH} diff --git a/.woodpecker/.mingw.yml b/.woodpecker/.mingw.yml index 41dd010..88e0003 100644 --- a/.woodpecker/.mingw.yml +++ b/.woodpecker/.mingw.yml @@ -13,11 +13,15 @@ steps: - cargo build --release --target x86_64-pc-windows-gnu - strip target/x86_64-pc-windows-gnu/release/cggitem_sets.exe when: - path: - include: ['.woodpecker/*.yml', 'src/*', 'Cargo*'] - event: [push, pull_request, manual, tag] +# path: +# include: ['.woodpecker/*.yml', 'src/*', 'Cargo*'] + - event: [manual, tag] + - event: push + branch: renovate/* + - event: push + branch: ${CI_REPO_DEFAULT_BRANCH} deploy: - image: alpine:latest + image: alpine:3.20 pull: true commands: - apk add --no-cache curl @@ -27,5 +31,4 @@ steps: path: include: ['.woodpecker/*.yml', 'src/*', 'Cargo*'] event: [push, manual, tag] - branch: - - master + branch: ${CI_REPO_DEFAULT_BRANCH} diff --git a/.woodpecker/.test.yml b/.woodpecker/.test.yml new file mode 100644 index 0000000..aa4b8a6 --- /dev/null +++ b/.woodpecker/.test.yml @@ -0,0 +1,41 @@ +clone: + - name: clone + image: woodpeckerci/plugin-git:2.5.0 + settings: + partial: false + when: + - event: [pull_request, manual, tag] + - event: push + branch: renovate/* + - event: push + branch: ${CI_REPO_DEFAULT_BRANCH} +steps: + test: + image: rust:alpine + pull: true + commands: + - apk add --no-cache musl-dev openssl-dev +# - cargo install cargo-tarpaulin + - rustup component add clippy +# - cargo tarpaulin --out Lcov + - cargo clippy --message-format=json &> clippy-report.json + when: +# path: +# include: ['.woodpecker/*.yml', 'src/*', 'Cargo*'] + - event: [pull_request, manual, tag] + - event: push + branch: renovate/* + - event: push + branch: ${CI_REPO_DEFAULT_BRANCH} + sonar: + image: sonarsource/sonar-scanner-cli:10 + pull: true + commands: + - wget -q -O- https://git.nyyu.dev/nyyu/ci-scripts/raw/branch/main/sonar.sh | bash + secrets: [ sonar_host_url, sonar_token, gitea_token ] + when: +# path: +# include: ['.woodpecker/*.yml', 'src/*', 'Cargo*'] + - event: [pull_request, manual, tag] + - event: push + branch: ${CI_REPO_DEFAULT_BRANCH} diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..9d008de --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=dev.nyyu:cggitem_sets +sonar.projectName=CGGItemSets +sonar.sources=src +sonar.rust.clippy.reportPaths=clippy-report.json +community.rust.lcov.reportPaths=lcov.info -- 2.45.2