Skip to content

Commit

Permalink
Add github actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rivnakm committed Dec 29, 2024
1 parent df8cc93 commit 9b64851
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and Test Action

on:
push:
branches:
- main
- develop
pull_request:
types:
- opened
- synchronize

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: dotnet restore
run: |
dotnet tool restore
dotnet restore
- name: Build
run: |
dotnet build --no-restore --configuration Release
- name: Run unit tests
run: |
dotnet test --no-build --settings=unit_tests.runsettings --collect:"XPlat Code Coverage" --logger "trx;LogFileName=TestResults.xml"
- name: Run integration tests
run: |
dotnet test --no-build --settings=integration_tests.runsettings --logger "trx;LogFileName=TestResults.xml"
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
./**/TestResults.xml
- name: Upload test coverage report
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions all_tests.runsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<RunConfiguration>
<EnvironmentVariables>
<RUN_INTEGRATION_TESTS>true</RUN_INTEGRATION_TESTS>
</EnvironmentVariables>
</RunConfiguration>
</RunSettings>

0 comments on commit 9b64851

Please sign in to comment.