Skip to content

Commit

Permalink
Merge branch 'main' into RSN-38
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoper02 committed Apr 29, 2024
2 parents fa27fa5 + 9ceecc1 commit b6f34d6
Show file tree
Hide file tree
Showing 103 changed files with 9,909 additions and 16,530 deletions.
15 changes: 14 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# MOBILE
MOBILE_LISTEN_PORT=5274
RCT_METRO_PORT=5274
REACT_NATIVE_PACKAGER_HOSTNAME=YOUR_IP_ADDRESS

# WEB
WEB_LISTEN_PORT=5273

# SERVER
ASPNETCORE_ENVIRONMENT=Development

SERVER_LISTEN_PORT=5272

# POSTGRES
POSTGRES_USER=dba
POSTGRES_PASSWORD=sql
Expand All @@ -12,4 +25,4 @@ POSTGRES_CLIENT_PASSWORD=sql
# PGADMIN
PGADMIN_LISTEN_PORT=5050
PGADMIN_DEFAULT_EMAIL=[email protected]
PGADMIN_DEFAULT_PASSWORD=sql
PGADMIN_DEFAULT_PASSWORD=sql
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sh text eol=lf
71 changes: 53 additions & 18 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
name: unit tests

on: [push]

env:
DOTNET_MINIMUM_TEST_COVERAGE: 0

jobs:
tests:
runs-on: ubuntu-latest
dotnet-tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ./Server/ReasnAPI
steps:
- uses: actions/checkout@v4
- name: Determine ReasnAPI solution
run: echo SOLUTION_FILE=$(realpath ./Server/ReasnAPI/ReasnAPI.sln) >> $GITHUB_ENV


- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
Expand All @@ -19,26 +25,55 @@ jobs:
run: dotnet tool install -g coverlet.console

- name: Install dependencies
run: dotnet restore ${{ env.SOLUTION_FILE }}
run: dotnet restore

- name: Build solution
run: dotnet build ${{ env.SOLUTION_FILE }} --no-restore
run: dotnet build --no-restore

- name: Test with dotnet
run: |
RESULTS_FILENAME=results-$(date +"%Y-%m-%d_%H_%M_%S")
dotnet test ${{ env.SOLUTION_FILE }} --logger "trx;logfilename=$RESULTS_FILENAME.trx" --logger "html;logfilename=$RESULTS_FILENAME.html" --no-build --results-directory "TestResults-${{ github.sha }}"
run: >
dotnet test
--no-build
--verbosity normal
--logger "trx;logfilename=${{ matrix.os }}-commit-${{ github.sha }}.trx"
--results-directory "TestResults-${{ matrix.os }}-commit-${{ github.sha }}"
- name: Run coverlet
run: |
TEST_ASSEMBLY=$(find ./Server/ReasnAPI/ReasnAPI.Tests/bin/ -name "ReasnAPI.Tests.dll")
coverlet "$TEST_ASSEMBLY" --target "dotnet" --targetargs "test ${{ env.SOLUTION_FILE }} --no-build"
run: >
coverlet .
--target "dotnet"
--targetargs "test --no-build"
--threshold ${{ env.DOTNET_MINIMUM_TEST_COVERAGE }}
- name: Upload dotnet test results
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: dotnet-results-${{ github.sha }}
path: TestResults-${{ github.sha }}
retention-days: 14

name: dotnet-results-${{ matrix.os }}-commit-${{ github.sha }}
path: TestResults-${{ matrix.os }}-commit-${{ github.sha }}
retention-days: 14

client-tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ./Client/reasn-client
steps:
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '21.7.x'

- name: Set yarn version
run: yarn set version 4.1

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Test with jest
run: yarn test --coverage --ci
Loading

0 comments on commit b6f34d6

Please sign in to comment.