Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Add retry to GitHub actions, refactor (#203)
Leendert de Borste1f729f2eda2
diff --git a/.github/workflows/docker-compose-build.yml b/.github/workflows/docker-compose-build.ymlindex a832b2b96..85656da2f 100644--- a/.github/workflows/docker-compose-build.yml+++ b/.github/workflows/docker-compose-build.yml@@ -9,61 +9,80 @@ on:jobs:test-docker:runs-on: ubuntu-latest+services:docker:image: docker:26.0.0options: --privileged+steps:- uses: actions/checkout@v2- name: Set permissions and run install.shrun: |chmod +x install.sh./install.sh+- name: Set up Docker Composerun: |# Change the exposed host port of the SmtpService from 25 to 2525 because port 25 is not allowed in GitHub Actionssed -i 's/25\:25/2525\:25/g' docker-compose.ymldocker compose -f docker-compose.yml up -d+- name: Wait for services to be uprun: |# Wait for a few seconds- sleep 5- - name: Test if localhost:80 (WASM app) responds- run: |- # Test if the service on localhost:80 responds- http_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:80)- if [ "$http_code" -ne 200 ]; then- echo "Service did not respond with 200 OK. Check if client app is configured correctly."- exit 1- else- echo "Service responded with 200 OK"- fi- - name: Test if localhost:81 (WebApi) responds- run: |- # Test if the service on localhost:81 responds- http_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:81)- if [ "$http_code" -ne 200 ]; then- echo "Service did not respond with expected 200 OK. Check if WebApi is configured correctly."- exit 1- else- echo "Service responded with $http_code"- fi- - name: Test if localhost:2525 (SmtpService) responds- run: |- # Test if the service on localhost:2525 responds- if ! nc -zv localhost 2525 2>&1 | grep -q 'succeeded'; then- echo "SmtpService did not respond on port 2525. Check if the SmtpService service is running."- exit 1- else- echo "SmtpService responded on port 2525"- fi- - name: Test if localhost:8080 (Admin) responds- run: |- # Test if the service on localhost:8080 responds- http_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/user/login)- if [ "$http_code" -ne 200 ]; then- echo "Service did not respond with expected 200 OK. Check if admin app is configured correctly."- exit 1- else- echo "Service responded with $http_code"- fi+ sleep 10+ - name: Test if localhost:80 (WASM app) responds+ uses: nick-fields/retry@v3+ with:+ timeout_minutes: 2+ max_attempts: 3+ command: |+ http_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:80)+ if [ "$http_code" -ne 200 ]; then+ echo "Service did not respond with 200 OK. Check if client app is configured correctly."+ exit 1+ else+ echo "Service responded with 200 OK"+ fi++ - name: Test if localhost:81 (WebApi) responds+ uses: nick-fields/retry@v3+ with:+ timeout_minutes: 2+ max_attempts: 3+ command: |+ http_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:81)+ if [ "$http_code" -ne 200 ]; then+ echo "Service did not respond with expected 200 OK. Check if WebApi is configured correctly."+ exit 1+ else+ echo "Service responded with $http_code"+ fi++ - name: Test if localhost:2525 (SmtpService) responds+ uses: nick-fields/retry@v3+ with:+ timeout_minutes: 2+ max_attempts: 3+ command: |+ if ! nc -zv localhost 2525 2>&1 | grep -q 'succeeded'; then+ echo "SmtpService did not respond on port 2525. Check if the SmtpService service is running."+ exit 1+ else+ echo "SmtpService responded on port 2525"+ fi++ - name: Test if localhost:8080 (Admin) responds+ uses: nick-fields/retry@v3+ with:+ timeout_minutes: 2+ max_attempts: 3+ command: |+ http_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/user/login)+ if [ "$http_code" -ne 200 ]; then+ echo "Service did not respond with expected 200 OK. Check if admin app is configured correctly."+ exit 1+ else+ echo "Service responded with $http_code"+ fidiff --git a/.github/workflows/dotnet-e2e-tests.yml b/.github/workflows/dotnet-e2e-tests.ymlindex 659155904..fd6ceb7c7 100644--- a/.github/workflows/dotnet-e2e-tests.yml+++ b/.github/workflows/dotnet-e2e-tests.yml@@ -15,33 +15,37 @@ jobs:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v4+- name: Setup .NETuses: actions/setup-dotnet@v4with:dotnet-version: 8.0.x+- name: Install dependenciesrun: dotnet workload install wasm-tools+- name: Buildrun: dotnet build+- name: Ensure browsers are installedrun: pwsh src/Tests/AliasVault.E2ETests/bin/Debug/net8.0/playwright.ps1 install --with-deps- name: Run AdminTests with retry- uses: nick-invision/retry@v2+ uses: nick-fields/retry@v3with:timeout_minutes: 10max_attempts: 3command: dotnet test src/Tests/AliasVault.E2ETests --no-build --verbosity normal --filter "Category=AdminTests"- name: Run ClientTests with retry- uses: nick-invision/retry@v2+ uses: nick-fields/retry@v3with:timeout_minutes: 10max_attempts: 3command: dotnet test src/Tests/AliasVault.E2ETests --no-build --verbosity normal --filter "Category=ClientTests"- name: Run remaining tests with retry- uses: nick-invision/retry@v2+ uses: nick-fields/retry@v3with:timeout_minutes: 10max_attempts: 3diff --git a/.github/workflows/dotnet-integration-tests.yml b/.github/workflows/dotnet-integration-tests.ymlindex 31330a2e3..76e87bf83 100644--- a/.github/workflows/dotnet-integration-tests.yml+++ b/.github/workflows/dotnet-integration-tests.yml@@ -15,13 +15,17 @@ jobs:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v4+- name: Setup .NETuses: actions/setup-dotnet@v4with:dotnet-version: 8.0.x+- name: Install dependenciesrun: dotnet workload install wasm-tools+- name: Buildrun: dotnet build+- name: Run integration testsrun: dotnet test src/Tests/AliasVault.IntegrationTests --no-build --verbosity normaldiff --git a/.github/workflows/dotnet-unit-tests.yml b/.github/workflows/dotnet-unit-tests.ymlindex 75314608b..3ee628f2c 100644--- a/.github/workflows/dotnet-unit-tests.yml+++ b/.github/workflows/dotnet-unit-tests.yml@@ -14,15 +14,20 @@ jobs:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v4+- name: Setup .NETuses: actions/setup-dotnet@v4with:dotnet-version: 8.0.x+- name: Install dependenciesrun: dotnet workload install wasm-tools+- name: Restore dependenciesrun: dotnet restore+- name: Buildrun: dotnet build --no-restore+- name: Run unittestsrun: dotnet test src/Tests/AliasVault.UnitTests --no-build --verbosity normaldiff --git a/.github/workflows/sonarcloud-code-analysis.yml b/.github/workflows/sonarcloud-code-analysis.ymlindex f5c365a03..2e14aaab7 100644--- a/.github/workflows/sonarcloud-code-analysis.yml+++ b/.github/workflows/sonarcloud-code-analysis.yml@@ -15,15 +15,18 @@ jobs:with:java-version: 17distribution: 'zulu' # Alternative distribution options are available.+- uses: actions/checkout@v3with:fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis+- name: Cache SonarCloud packagesuses: actions/cache@v3with:path: ~\sonar\cachekey: ${{ runner.os }}-sonarrestore-keys: ${{ runner.os }}-sonar+- name: Cache SonarCloud scannerid: cache-sonar-scanneruses: actions/cache@v3@@ -31,15 +34,17 @@ jobs:path: .\.sonar\scannerkey: ${{ runner.os }}-sonar-scannerrestore-keys: ${{ runner.os }}-sonar-scanner+- name: Install SonarCloud scannerif: steps.cache-sonar-scanner.outputs.cache-hit != 'true'shell: powershellrun: |New-Item -Path .\.sonar\scanner -ItemType Directorydotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner+- name: Build and analyzeenv:- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}shell: powershellrun: |diff --git a/src/AliasVault.Client/Dockerfile b/src/AliasVault.Client/Dockerfileindex a70540c77..0f47633e1 100644--- a/src/AliasVault.Client/Dockerfile+++ b/src/AliasVault.Client/Dockerfile@@ -21,7 +21,7 @@ COPY ["src/AliasGenerators/AliasGenerators.csproj", "src/AliasGenerators/"]COPY ["src/Utilities/FaviconExtractor/FaviconExtractor.csproj", "src/Utilities/FaviconExtractor/"]RUN dotnet restore "src/AliasVault.Client/AliasVault.Client.csproj"-# Copy the rest of the application code+# Copy the application codeCOPY . .# Build the Client project