(#23) logging: update tests [build-test-force] [pack-all-force] #99
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: .NET CI Build, Test, and Publish | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
# Identify changed libraries and run the build and tests | |
build_test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 100 # Fetch two commits for proper diff | |
- name: Set up .NET SDK | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '9.x' | |
- name: Run script to identify changed libraries | |
run: | | |
chmod +x ./scripts/identify-changed-libraries.sh | |
./scripts/identify-changed-libraries.sh | |
- name: Build and test libraries | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # Use the secret token for Codecov | |
run: | | |
chmod +x ./scripts/build-and-test.sh | |
./scripts/build-and-test.sh | |
- name: Upload test results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: TestResults | |
path: src/*/TestResults/ | |
# Publish job after build and tests are successful | |
publish: | |
if: github.ref == 'refs/heads/main' | |
needs: build_test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up .NET SDK | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '9.x' | |
- name: Decode and save certificate | |
run: | | |
echo "${{ secrets.CERTIFICATE_BASE64 }}" | base64 --decode > certificate.cer | |
echo "${{ secrets.PRIVATE_KEY_BASE64 }}" | base64 --decode > privatekey.pem | |
- name: Run publish script for all packages | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
CERTIFICATE_PATH: certificate.cer | |
PRIVATE_KEY_PATH: privatekey.pem | |
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }} | |
run: | | |
chmod +x ./scripts/pack-all.sh | |
./scripts/pack-all.sh |