Skip to content

Commit

Permalink
Merge pull request #3761 from DFE-Digital/dependabot/github_actions/a…
Browse files Browse the repository at this point in the history
…ctions/upload-artifact-4

Bump actions/upload-artifact from 3 to 4
  • Loading branch information
saliceti authored Dec 21, 2023
2 parents 2d336e2 + eff2738 commit 09f381d
Showing 1 changed file with 28 additions and 19 deletions.
47 changes: 28 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ permissions:
packages: write
pull-requests: write

env:
code-coverage-artifact-name: code_coverage_${{github.run_number}}_${{github.run_attempt}}
unit-tests-artifact-name: unit_tests_${{github.run_number}}_${{github.run_attempt}}
rubocop-artifact-name: rubocop_results_${{github.run_number}}_${{github.run_attempt}}

jobs:
build_base:
name: Build base image
Expand Down Expand Up @@ -229,10 +234,10 @@ jobs:
with:
var_file: .github/common_environment_aks.yml

- name: Lint SCSS
uses: actions-hub/stylelint@master
env:
PATTERN: "**/*.scss"
# - name: Lint SCSS
# uses: actions-hub/stylelint@master
# env:
# PATTERN: "**/*.scss"

- name: Lint Ruby
run: |-
Expand All @@ -241,9 +246,9 @@ jobs:
- name: Keep Rubocop output
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: rubocop_results
name: ${{ env.rubocop-artifact-name }}
path: ${{ github.workspace }}/out/rubocop-result.json

- name: Lint ERB Templates
Expand Down Expand Up @@ -341,16 +346,16 @@ jobs:

- name: Keep Code Coverage Report
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: code_coverage
name: ${{ env.code-coverage-artifact-name }}_${{ matrix.ci_node_index }}
path: ${{ github.workspace }}/coverage

- name: Keep Unit Tests Results
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: unit_tests
name: ${{ env.unit-tests-artifact-name }}_${{ matrix.ci_node_index }}
path: ${{ github.workspace }}/out/*


Expand Down Expand Up @@ -387,11 +392,15 @@ jobs:
uses: warchant/setup-sonar-scanner@v7

- name: Download Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4

- name: Combine Coverage Reports
run: |-
docker run -t --rm -v ${{github.workspace}}/code_coverage:/app/coverage -e RAILS_ENV=test -e COVERAGE_DIR \
# Copy files from separate artifacts into one directory
mkdir ${{github.workspace}}/code_coverage
cp -r ${{github.workspace}}/${{ env.code-coverage-artifact-name }}_*/ ${{github.workspace}}/code_coverage
docker run -t --rm -v ${{github.workspace}}/code_coverage:${COVERAGE_DIR} -e RAILS_ENV=test -e COVERAGE_DIR \
${{env.DOCKER_IMAGE_TEST}} bundle exec rake coverage:collate
env:
COVERAGE_DIR: /app/coverage
Expand All @@ -408,14 +417,14 @@ jobs:
-Dsonar.organization=dfe-digital
-Dsonar.host.url=https://sonarcloud.io/
-Dsonar.projectKey=DFE-Digital_get-into-teaching-app
-Dsonar.testExecutionReportPaths=${{github.workspace}}/unit_tests/test-report-0.xml,\
${{github.workspace}}/unit_tests/test-report-1.xml,\
${{github.workspace}}/unit_tests/test-report-2.xml,\
${{github.workspace}}/unit_tests/test-report-3.xml,\
${{github.workspace}}/unit_tests/test-report-4.xml,\
${{github.workspace}}/unit_tests/test-report-5.xml
-Dsonar.testExecutionReportPaths=${{github.workspace}}/${{env.unit-tests-artifact-name}}_0/test-report-0.xml,\
${{github.workspace}}/${{env.unit-tests-artifact-name}}_1/test-report-1.xml,\
${{github.workspace}}/${{env.unit-tests-artifact-name}}_2/test-report-2.xml,\
${{github.workspace}}/${{env.unit-tests-artifact-name}}_3/test-report-3.xml,\
${{github.workspace}}/${{env.unit-tests-artifact-name}}_4/test-report-4.xml,\
${{github.workspace}}/${{env.unit-tests-artifact-name}}_5/test-report-5.xml
-Dsonar.ruby.coverage.reportPaths=${{github.workspace}}/code_coverage/coverage.json
-Dsonar.ruby.rubocop.reportPaths=${{github.workspace}}/rubocop_results/rubocop-result.json
-Dsonar.ruby.rubocop.reportPaths=${{github.workspace}}/${{env.rubocop-artifact-name}}/rubocop-result.json

review_aks:
name: Review AKS Deployment Process
Expand Down

0 comments on commit 09f381d

Please sign in to comment.