Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
GraziellePinheiro committed Aug 22, 2024
2 parents 09aeae2 + 9ba8b5f commit 95d872a
Showing 1 changed file with 21 additions and 32 deletions.
53 changes: 21 additions & 32 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Java CI with Maven
name: CI

on:
push:
Expand All @@ -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

0 comments on commit 95d872a

Please sign in to comment.