-
Notifications
You must be signed in to change notification settings - Fork 2
34 lines (34 loc) · 1.98 KB
/
run-unit-tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Unit Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
run-unit-tests:
timeout-minutes: 6
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Create .env file
run: |
echo "EMAIL=${{ secrets.EMAIL }}" >> .env
echo "PASSWORD=${{ secrets.PASSWORD }}" >> .env
echo "CLIENT_ID=${{ secrets.CLIENT_ID }}" >> .env
echo "CLIENT_SECRET=${{ secrets.CLIENT_SECRET }}" >> .env
- name: Add test dependencies to pom.xml
run: |
sed -i '/<dependencies>/a <dependency> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.3.1</version> <scope>test</scope> </dependency>' pom.xml
sed -i '/<dependencies>/a <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-engine</artifactId> <version>5.8.1</version> <scope>test</scope> </dependency>' pom.xml
sed -i '/<dependencies>/a <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-api</artifactId> <version>5.8.1</version> <scope>test</scope> </dependency>' pom.xml
sed -i '/<dependencies>/a <dependency> <groupId>com.microsoft.playwright</groupId> <artifactId>playwright</artifactId> <version>1.18.0</version> </dependency>' pom.xml
sed -i '/<dependencies>/a <dependency> <groupId>io.github.cdimascio</groupId> <artifactId>dotenv-java</artifactId> <version>2.2.0</version> </dependency>' pom.xml
sed -i '/<plugins>/a <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.3.1</version> <configuration> <!-- Add any specific configuration for Surefire here --> </configuration> </plugin>' pom.xml
- name: Build & Install
run: mvn -B install -D skipTests --no-transfer-progress
- name: Run tests
run: mvn test -Dtest=**/com/paypal/api/UnitTests/**/*