-
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
99 additions
and
136 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,53 @@ | ||
# 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 | ||
|
||
steps: | ||
- name: checkout source | ||
uses: actions/checkout@v2 | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- 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 | ||
|
||
- name: use nuget cache | ||
uses: actions/cache@v2 | ||
uses: actions/cache@v4 | ||
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/[email protected] | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
# Workflow to build and test the csharp version | ||
name: csharp-simple-build | ||
|
||
# Controls when the action will run. | ||
on: | ||
push: | ||
paths: | ||
- 'csharp-simple/**' | ||
- '**/csharp-simple-build.yml' | ||
- '.github/workflows/csharp-simple-build.yml' | ||
pull_request: | ||
paths: | ||
- 'csharp-simple/**' | ||
- '**/csharp-simple-build.yml' | ||
|
||
defaults: | ||
run: | ||
working-directory: ./csharp-simple | ||
- '.github/workflows/csharp-simple-build.yml' | ||
|
||
jobs: | ||
build: | ||
defaults: | ||
run: | ||
working-directory: ./csharp-simple | ||
|
||
runs-on: ubuntu-latest | ||
|
||
|
@@ -27,27 +24,26 @@ jobs: | |
DB_PASSWORD: mysql | ||
|
||
steps: | ||
- name: checkout source | ||
uses: actions/checkout@v2 | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- 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 | ||
|
||
- name: use nuget cache | ||
uses: actions/cache@v2 | ||
uses: actions/cache@v4 | ||
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 | ||
|
@@ -57,13 +53,3 @@ jobs: | |
|
||
- name: run unit tests | ||
run: dotnet test --logger "trx;logfilename=${GITHUB_WORKSPACE}/unit_test_results.xml" | ||
|
||
- name: Test Reporter | ||
uses: dorny/[email protected] | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,35 @@ | ||
# Workflow to build and test the java version | ||
|
||
name: java-build | ||
|
||
env: | ||
PROJECT_DIR: java | ||
|
||
# Controls when the action will run. | ||
on: | ||
push: | ||
paths: | ||
- 'java/**' | ||
- '**/java-build.yml' | ||
|
||
- '.github/workflows/java-build.yml' | ||
pull_request: | ||
paths: | ||
- 'java/**' | ||
- '**/java-build.yml' | ||
- '.github/workflows/java-build.yml' | ||
|
||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
defaults: | ||
run: | ||
working-directory: ./${{ env.PROJECT_DIR }} | ||
working-directory: ./java | ||
|
||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
DB_USER: root | ||
DB_OLD_PASSWORD: root | ||
DB_PASSWORD: mysql | ||
|
||
strategy: | ||
matrix: | ||
java-version: [8, 11, 17, 21] | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Start MYSQL and import DB | ||
run: | | ||
|
@@ -43,24 +38,18 @@ jobs: | |
mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < ${GITHUB_WORKSPACE}/database/initDatabase.sql | ||
- name: Set up Java | ||
uses: actions/setup-java@v2 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'adopt' | ||
java-version: '11' | ||
java-version: ${{ matrix.java-version }} | ||
|
||
- name: Cache Maven packages | ||
uses: actions/cache@v2 | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('./pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
|
||
- name: Build and test | ||
run: | | ||
mvn -B clean install -DskipTests | ||
- name: Publish Unit Tests | ||
uses: EnricoMi/[email protected] | ||
if: always() | ||
with: | ||
files: ./${{ env.PROJECT_DIR }}/target/**/*.xml | ||
mvn -B clean verify -DskipTests |
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,40 +1,35 @@ | ||
# Workflow to build and test the java-simple version | ||
|
||
name: java-simple-build | ||
|
||
env: | ||
PROJECT_DIR: java-simple | ||
|
||
# Controls when the action will run. | ||
on: | ||
push: | ||
paths: | ||
- 'java-simple/**' | ||
- '**/java-simple-build.yml' | ||
|
||
- '.github/workflows/java-simple-build.yml' | ||
pull_request: | ||
paths: | ||
- 'java-simple/**' | ||
- '**/java-simple-build.yml' | ||
- '.github/workflows/java-simple-build.yml' | ||
|
||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
defaults: | ||
run: | ||
working-directory: ./${{ env.PROJECT_DIR }} | ||
working-directory: ./java-simple | ||
|
||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
DB_USER: root | ||
DB_OLD_PASSWORD: root | ||
DB_PASSWORD: mysql | ||
|
||
strategy: | ||
matrix: | ||
java-version: [8, 11, 17, 21] | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Start MYSQL and import DB | ||
run: | | ||
|
@@ -43,24 +38,18 @@ jobs: | |
mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < ${GITHUB_WORKSPACE}/database/initDatabase.sql | ||
- name: Set up Java | ||
uses: actions/setup-java@v2 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'adopt' | ||
java-version: '11' | ||
java-version: ${{ matrix.java-version }} | ||
|
||
- name: Cache Maven packages | ||
uses: actions/cache@v2 | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('./pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
|
||
- name: Build and test | ||
run: | | ||
mvn -B clean install | ||
- name: Publish Unit Tests | ||
uses: EnricoMi/[email protected] | ||
if: always() | ||
with: | ||
files: ./${{ env.PROJECT_DIR }}/target/**/*.xml | ||
mvn -B clean verify |
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.