diff --git a/.github/workflows/docker-dry-run.yml b/.github/workflows/docker-dry-run.yml deleted file mode 100644 index a8e3a54..0000000 --- a/.github/workflows/docker-dry-run.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Dry Run - -on: workflow_call - -jobs: - dry-run: - name: Dry Run - runs-on: ubuntu-latest - steps: - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push - uses: docker/build-push-action@v6 - with: - push: false - tags: gb3-search-api:latest \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2a37479..693adb1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,6 +10,9 @@ on: - main - develop +env: + coverage_cache_key: python-coverage-report-${{ github.sha }}-${{ github.run_id }} + jobs: python: name: Python @@ -17,11 +20,22 @@ jobs: docker: name: Docker - uses: ./.github/workflows/docker-dry-run.yml + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: gisktzh/github-actions/docker-dry-run@main + with: + image: gb3-search-api sonarcloud: name: SonarCloud - uses: ./.github/workflows/sonar-analysis.yml needs: python - secrets: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: gisktzh/github-actions/sonarcloud-analysis@main + with: + sonar_token: ${{ secrets.SONAR_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} + coverage_file_path: coverage.xml + coverage_cache_key: ${{ env.coverage_cache_key }} \ No newline at end of file diff --git a/.github/workflows/sonar-analysis.yml b/.github/workflows/sonar-analysis.yml deleted file mode 100644 index 0685a08..0000000 --- a/.github/workflows/sonar-analysis.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Analyze Code Quality - -on: - workflow_call: - secrets: - SONAR_TOKEN: - required: true - -jobs: - sonarcloud: - name: SonarCloud - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Restore cached coverage report - uses: actions/cache@v4 - with: - path: coverage.xml - key: python-coverage-report-${{ github.sha }}-${{ github.run_id }} - - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file