From 9ba8b5fb90e025dc695117de0c51cd016d925287 Mon Sep 17 00:00:00 2001 From: GraziellePinheiro <66564318+GraziellePinheiro@users.noreply.github.com> Date: Thu, 22 Aug 2024 17:58:51 -0300 Subject: [PATCH] Update maven.yml --- .github/workflows/maven.yml | 53 +++++++++++++++---------------------- 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index ae9e5b6..92282ab 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,4 +1,4 @@ -name: Java CI with Maven +name: CI on: push: @@ -11,38 +11,27 @@ on: jobs: build: runs-on: windows-latest - - strategy: - matrix: - java-version: ['11'] - steps: - - name: Checkout repository + - name: Check out code uses: actions/checkout@v3 - - name: Set up JDK ${{ matrix.java-version }} - uses: actions/setup-java@v4 - with: - java-version: ${{ matrix.java-version }} - distribution: temurin - - - name: Cache Maven packages - uses: actions/cache@v3 - with: - path: C:\Users\runneradmin\.m2\repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - - name: Build and test with Maven - run: mvn clean install - - - name: Run tests with Maven - run: mvn test - - - name: Upload test results - if: always() - uses: actions/upload-artifact@v4 + - name: Set up JDK 11 + uses: actions/setup-java@v3 with: - name: surefire-reports - path: target/surefire-reports/* + java-version: '11' + distribution: 'temurin' + + - name: Set up ChromeDriver + run: | + # Remove any existing ChromeDriver + if (Test-Path "C:\drivers\chocolatey\bin\chromedriver.exe") { + Remove-Item "C:\drivers\chocolatey\bin\chromedriver.exe" + } + # Download and install ChromeDriver + Invoke-WebRequest -Uri https://chromedriver.storage.googleapis.com/127.0.6533.99/chromedriver_win32.zip -OutFile chromedriver_win32.zip + Expand-Archive -Path chromedriver_win32.zip -DestinationPath C:\drivers\chocolatey\bin + [System.IO.File]::Move('C:\drivers\chocolatey\bin\chromedriver.exe', 'C:\drivers\chocolatey\bin\chromedriver.exe') + + - name: Run tests + run: | + mvn test