Skip to content

Commit

Permalink
ci(GitHub Actions): Update GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
oboukli committed Apr 5, 2024
1 parent 8f86163 commit 6e20d3c
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 28 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ on:
permissions: {}

env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NUGET_SIGNATURE_VERIFICATION: true
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
INTEGRATION_TEST_RESULTS_DIR_NAME: integration_test_results
UNIT_TEST_RESULTS_DIR_NAME: unit_test_results

Expand All @@ -26,9 +29,6 @@ jobs:
name: Solution build
runs-on: ubuntu-latest

env:
DOTNET_CLI_TELEMETRY_OPTOUT: true

steps:
- name: Check out repository
uses: actions/checkout@v4
Expand All @@ -48,7 +48,6 @@ jobs:
AKTABOOK_ENVIRONMENT: Test
AKTABOOK_INTEGRATION_TEST_ENVIRONMENT: Test
BUS_HOST_PID_FILE: src/Aktabook.Bus/bin/Release/net6.0/aktabook-bus.pid
DOTNET_CLI_TELEMETRY_OPTOUT: true
RequesterServiceBus__RabbitMQConnectionOptions__HostName: localhost
RequesterServiceBus__RabbitMQConnectionOptions__Password: ${{ secrets.RABBITMQ_INTEGRATION_TEST_PASSWORD }}
RequesterServiceBus__RabbitMQConnectionOptions__PortNumber: 5672
Expand Down Expand Up @@ -322,23 +321,23 @@ jobs:
>> $GITHUB_OUTPUT
- name: Upload test results archive
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ steps.get_artifact_name.outputs.artifact_name }}
path: ${{ env.INTEGRATION_TEST_RESULTS_DIR_NAME }}.7z

- name: Upload bus logs
if: ${{ always() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: bus-logs
path: src/Aktabook.Bus/bin/Release/net6.0/Logs

- name: Upload public API logs
if: ${{ always() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: public-api-logs
Expand Down Expand Up @@ -400,7 +399,7 @@ jobs:
>> $GITHUB_OUTPUT
- name: Upload test results archive
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ steps.get_artifact_name.outputs.artifact_name }}
Expand All @@ -414,9 +413,6 @@ jobs:
- unit_test
- integration_test

env:
DOTNET_CLI_TELEMETRY_OPTOUT: true

steps:
- name: Check out repository
uses: actions/checkout@v4
Expand All @@ -425,12 +421,12 @@ jobs:
persist-credentials: false

- name: Download integration test results
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ needs.integration_test.outputs.artifact_name }}

- name: Download unit test results
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ needs.unit_test.outputs.artifact_name }}

Expand All @@ -447,7 +443,7 @@ jobs:
${{ env.UNIT_TEST_RESULTS_DIR_NAME }}.7z
- name: Cache NuGet packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: >-
Expand All @@ -459,9 +455,13 @@ jobs:
${{ runner.os }}-nuget-
- name: Set up .NET SDK
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
cache: true
cache-dependency-path: |-
src/**/packages.lock.json
test/**/packages.lock.json
global-json-file: global.json

- name: Restore .NET tools
run: dotnet tool restore
Expand All @@ -485,7 +485,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
DOTNET_CLI_TELEMETRY_OPTOUT: true
run: >-
JAVA_HOME=$JAVA_HOME_17_X64
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/code-style-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,18 @@ jobs:

env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NUGET_SIGNATURE_VERIFICATION: true
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages

steps:
- name: Set up .NET SDK
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
cache: true
cache-dependency-path: |-
src/**/packages.lock.json
test/**/packages.lock.json
global-json-file: global.json

- name: Check out repository
uses: actions/checkout@v4
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/composite/dotnet-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
name: Build
description: Build .NET solution and cache restored NuGet packages

env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NUGET_SIGNATURE_VERIFICATION: true

inputs:
configuration:
description: .NET build configuration
Expand All @@ -16,7 +20,7 @@ runs:
using: composite
steps:
- name: Cache NuGet packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: >-
Expand All @@ -28,13 +32,15 @@ runs:
${{ runner.os }}-nuget-
- name: Set up .NET SDK
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
cache: true
cache-dependency-path: |-
src/**/packages.lock.json
test/**/packages.lock.json
global-json-file: global.json

- name: Restores dependencies
env:
DOTNET_NUGET_SIGNATURE_VERIFICATION: "true"
shell: bash
run: dotnet restore --locked-mode

Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ jobs:
persist-credentials: false

- name: Set up .NET SDK
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
cache: true
cache-dependency-path: |-
src/**/packages.lock.json
test/**/packages.lock.json
global-json-file: global.json

- name: Restores dependencies
run: >-
Expand Down Expand Up @@ -68,14 +72,14 @@ jobs:
--runtime ${{ env.AKTABOOK_DOTNET_RUNTIME_TARGET }}
- name: Upload bus binaries
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: aktabook_bus_${{ env.AKTABOOK_DOTNET_RUNTIME_TARGET }}
path: ${{ env.AKTABOOK_PUBLISH_PATH_ROOT }}/Aktabook.Bus/

- name: Upload API binaries
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: aktabook_api_${{ env.AKTABOOK_DOTNET_RUNTIME_TARGET }}
Expand Down

0 comments on commit 6e20d3c

Please sign in to comment.