Skip to content

Commit 6f8507a

Browse files
authored
fix(#1182): fix analysis workflow failing when pr is merged to the main branch (#1184)
1 parent 50c542f commit 6f8507a

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

.github/workflows/analysis.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ jobs:
1818
name: Tests Backend Oracle
1919
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
2020
runs-on: ubuntu-24.04
21-
env:
22-
FLYWAY_ENVIRONMENT: ${{ github.event_name == 'pull_request' && 'dev' || 'prod' }}
2321
steps:
2422
- uses: actions/checkout@v6
2523

@@ -38,7 +36,7 @@ jobs:
3836
if [ -f settings.xml ]; then
3937
cp settings.xml ~/.m2/settings.xml
4038
fi
41-
./mvnw -s ~/.m2/settings.xml clean install -Dflyway-environment=${{ env.FLYWAY_ENVIRONMENT }} -Dserver.primary-db=oracle --no-transfer-progress checkstyle:checkstyle -P all-tests
39+
./mvnw -s ~/.m2/settings.xml clean install -Dserver.primary-db=oracle --no-transfer-progress checkstyle:checkstyle -P all-tests
4240
4341
- name: Upload Oracle coverage artifact
4442
uses: actions/upload-artifact@v4
@@ -52,8 +50,6 @@ jobs:
5250
name: Tests Backend Postgres
5351
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
5452
runs-on: ubuntu-24.04
55-
env:
56-
FLYWAY_ENVIRONMENT: ${{ github.event_name == 'pull_request' && 'dev' || 'prod' }}
5753
steps:
5854
- uses: actions/checkout@v6
5955

@@ -72,7 +68,7 @@ jobs:
7268
if [ -f settings.xml ]; then
7369
cp settings.xml ~/.m2/settings.xml
7470
fi
75-
./mvnw -s ~/.m2/settings.xml clean install -Dflyway-environment=${{ env.FLYWAY_ENVIRONMENT }} -Dserver.primary-db=postgres --no-transfer-progress checkstyle:checkstyle -P all-tests
71+
./mvnw -s ~/.m2/settings.xml clean install -Dflyway-environment=dev -Dserver.primary-db=postgres --no-transfer-progress checkstyle:checkstyle -P all-tests
7672
7773
- name: Upload Postgres coverage artifact
7874
uses: actions/upload-artifact@v4

backend/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ cd <repo-directory>/backend
3030
#### Example for Oracle:
3131
```bash
3232
export PRIMARY_DB=oracle
33-
export FLYWAY_ENVIRONMENT=dev
3433
```
3534

3635
#### Example for PostgreSQL:
@@ -46,6 +45,8 @@ Using Maven Wrapper:
4645
./mvnw spring-boot:run
4746
```
4847

48+
**NOTE:** There is no need to set the `FLYWAY_ENVIRONMENT` environment variable when running the Oracle-primary instance, as the goal is to run the backend deployed to the production environment.
49+
4950
---
5051

5152
## Configuration
@@ -73,9 +74,11 @@ Flyway migrations are determined by the `FLYWAY_ENVIRONMENT` variable.
7374

7475
### Run Tests for Oracle:
7576
```bash
76-
./mvnw clean install -Dflyway-environment=dev -Dserver.primary-db=oracle
77+
./mvnw clean install -Dserver.primary-db=oracle
7778
```
7879

80+
**NOTE:** There is no need to pass the `flyway-environment` property or set the `FLYWAY_ENVIRONMENT` environment variable when running the Oracle tests, as the goal is to run the tests deployed to production.
81+
7982
### Run Tests for PostgreSQL:
8083
```bash
8184
./mvnw clean install -Dflyway-environment=dev -Dserver.primary-db=postgres

0 commit comments

Comments
 (0)