-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify builds and add matrix build with LTS versions.
- Loading branch information
Showing
9 changed files
with
104 additions
and
135 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,57 @@ | ||
# Workflow to build and test the csharp version | ||
name: csharp-build | ||
|
||
# Controls when the action will run. | ||
on: | ||
push: | ||
paths: | ||
- 'csharp/**' | ||
- '**/csharp-build.yml' | ||
- '.github/workflows/csharp-build.yml' | ||
pull_request: | ||
paths: | ||
- 'csharp/**' | ||
- '**/csharp-build.yml' | ||
|
||
defaults: | ||
run: | ||
working-directory: ./csharp | ||
- '.github/workflows/csharp-build.yml' | ||
|
||
jobs: | ||
build: | ||
|
||
defaults: | ||
run: | ||
working-directory: ./csharp | ||
|
||
runs-on: ubuntu-latest | ||
|
||
env: | ||
DB_USER: root | ||
DB_OLD_PASSWORD: root | ||
DB_PASSWORD: mysql | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
statuses: write | ||
checks: write | ||
|
||
strategy: | ||
matrix: | ||
dotnet-version: [3.1, 6.0, 8.0] | ||
|
||
steps: | ||
- name: checkout source | ||
uses: actions/checkout@v2 | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Start MYSQL and import DB | ||
run: | | ||
sudo systemctl start mysql | ||
mysqladmin --user=${{ env.DB_USER }} --password=${{ env.DB_OLD_PASSWORD }} password ${{ env.DB_PASSWORD }} | ||
mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < ../database/initDatabase.sql | ||
mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < ${GITHUB_WORKSPACE}/database/initDatabase.sql | ||
- name: Setup dotnet build | ||
uses: actions/setup-dotnet@v1 | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 3.1.x | ||
dotnet-version: ${{ matrix.dotnet-version }} | ||
|
||
- name: use nuget cache | ||
uses: actions/cache@v2 | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.nuget/packages | ||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-nuget | ||
restore-keys: ${{ runner.os }}-nuget | ||
|
||
- name: install dependencies | ||
run: dotnet restore | ||
|
||
- name: build solution | ||
run: dotnet build | ||
|
||
- name: Test Reporter | ||
uses: dorny/test-reporter@v1.5.0 | ||
if: always() | ||
with: | ||
name: publish test results | ||
|
||
path: "unit_test_results.xml" | ||
reporter: dotnet-trx | ||
fail-on-error: false |
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
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
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
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
Oops, something went wrong.