mirror of
https://github.com/akuker/RASCSI.git
synced 2024-06-10 02:29:33 +00:00
Run Python static analysis only in Web workflow
This commit is contained in:
parent
029cf06c72
commit
28034a04a9
12
.github/workflows/cpp.yml
vendored
12
.github/workflows/cpp.yml
vendored
|
@ -3,9 +3,9 @@ name: C++ Tests/Analysis
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
paths:
|
branches:
|
||||||
- 'cpp/**'
|
- 'develop'
|
||||||
- '.github/workflows/cpp.yml'
|
- 'main'
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- 'cpp/**'
|
- 'cpp/**'
|
||||||
|
@ -15,9 +15,6 @@ on:
|
||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
- reopened
|
- reopened
|
||||||
branches:
|
|
||||||
- 'develop'
|
|
||||||
- 'main'
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
APT_PACKAGES: libspdlog-dev libpcap-dev libevdev2 libev-dev protobuf-compiler libgtest-dev libgmock-dev
|
APT_PACKAGES: libspdlog-dev libpcap-dev libevdev2 libev-dev protobuf-compiler libgtest-dev libgmock-dev
|
||||||
|
@ -117,5 +114,4 @@ jobs:
|
||||||
--define sonar.cfamily.gcov.reportsPath=.
|
--define sonar.cfamily.gcov.reportsPath=.
|
||||||
--define sonar.coverage.exclusions="cpp/**/test/**"
|
--define sonar.coverage.exclusions="cpp/**/test/**"
|
||||||
--define sonar.cpd.exclusions="cpp/**/test/**"
|
--define sonar.cpd.exclusions="cpp/**/test/**"
|
||||||
--define sonar.inclusions="cpp/**,python/**"
|
--define sonar.inclusions="cpp/**"
|
||||||
--define sonar.python.version=3.7,3.9
|
|
||||||
|
|
69
.github/workflows/web.yml
vendored
69
.github/workflows/web.yml
vendored
|
@ -3,11 +3,9 @@ name: Web Tests/Analysis
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
paths:
|
branches:
|
||||||
- 'python/web/**'
|
- 'develop'
|
||||||
- 'python/common/**'
|
- 'main'
|
||||||
- '.github/workflows/web.yml'
|
|
||||||
- 'easyinstall.sh'
|
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- 'python/web/**'
|
- 'python/web/**'
|
||||||
|
@ -19,9 +17,6 @@ on:
|
||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
- reopened
|
- reopened
|
||||||
branches:
|
|
||||||
- 'develop'
|
|
||||||
- 'main'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
backend_checks:
|
backend_checks:
|
||||||
|
@ -146,3 +141,61 @@ jobs:
|
||||||
npx prettier --check src/static/themes/modern/style.css
|
npx prettier --check src/static/themes/modern/style.css
|
||||||
npx prettier --check src/static/themes/classic/style.css
|
npx prettier --check src/static/themes/classic/style.css
|
||||||
if: success() || failure() && steps.npm.outcome == 'success'
|
if: success() || failure() && steps.npm.outcome == 'success'
|
||||||
|
|
||||||
|
sonarcloud:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
if: github.repository == 'PiSCSI/piscsi'
|
||||||
|
env:
|
||||||
|
SOURCES: python
|
||||||
|
BUILD_WRAPPER_OUT_DIR: "$HOME/.build_wrapper_out" # Directory where build-wrapper output will be placed
|
||||||
|
SONAR_SCANNER_VERSION: 5.0.1.3006
|
||||||
|
SONAR_SERVER_URL: "https://sonarcloud.io"
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
SONAR_PROJECT_KEY: "akuker-PISCSI"
|
||||||
|
SONAR_ORGANIZATION: "piscsi"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||||
|
|
||||||
|
- name: Set up JDK 17
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 17
|
||||||
|
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
name: Cache SonarCloud setup
|
||||||
|
id: sonar-install-cache
|
||||||
|
with:
|
||||||
|
path: ~/.sonar
|
||||||
|
key: sonar-with-build-wrapper-${{ env.SONAR_SCANNER_VERSION }}
|
||||||
|
|
||||||
|
- name: Set up SonarCloud scanner
|
||||||
|
if: steps.sonar-install-cache.outputs.cache-hit != 'true'
|
||||||
|
env:
|
||||||
|
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip
|
||||||
|
run: |
|
||||||
|
mkdir -p $HOME/.sonar
|
||||||
|
curl -sSLo /tmp/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }}
|
||||||
|
unzip -o /tmp/sonar-scanner.zip -d $HOME/.sonar/
|
||||||
|
|
||||||
|
- name: Set up SonarCloud build wrapper
|
||||||
|
if: steps.sonar-install-cache.outputs.cache-hit != 'true'
|
||||||
|
env:
|
||||||
|
BUILD_WRAPPER_DOWNLOAD_URL: ${{ env.SONAR_SERVER_URL }}/static/cpp/build-wrapper-linux-x86.zip
|
||||||
|
run: |
|
||||||
|
curl -sSLo /tmp/build-wrapper-linux-x86.zip ${{ env.BUILD_WRAPPER_DOWNLOAD_URL }}
|
||||||
|
unzip -o /tmp/build-wrapper-linux-x86.zip -d $HOME/.sonar/
|
||||||
|
|
||||||
|
- name: Run sonar-scanner
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: >-
|
||||||
|
$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin/sonar-scanner
|
||||||
|
--define sonar.host.url="${{ env.SONAR_SERVER_URL }}"
|
||||||
|
--define sonar.projectKey=${{ env.SONAR_PROJECT_KEY }}
|
||||||
|
--define sonar.organization=${{ env.SONAR_ORGANIZATION }}
|
||||||
|
--define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
|
||||||
|
--define sonar.cfamily.gcov.reportsPath=.
|
||||||
|
--define sonar.inclusions="python/**"
|
||||||
|
--define sonar.python.version=3.9,3.11
|
||||||
|
|
Loading…
Reference in New Issue
Block a user