diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e2a83ba --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: CI + +on: + push: + branches: [ master, main ] + pull_request: + branches: [ master, main ] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + with: + cache-cleanup: on-success + + - name: Make gradlew executable + run: chmod +x gradlew + + - name: Run tests + run: ./gradlew test + + - name: Upload test results + uses: actions/upload-artifact@v4 + if: always() + with: + name: test-results + path: build/reports/tests/test/ \ No newline at end of file diff --git a/build.gradle b/build.gradle index 4f8a815..51e7516 100644 --- a/build.gradle +++ b/build.gradle @@ -30,9 +30,14 @@ dependencies { testImplementation('org.spockframework:spock-core:2.4-M6-groovy-4.0') { exclude group: 'org.codehaus.groovy' } + + // Mocking libraries required by Spock for Java class mocking + testImplementation 'net.bytebuddy:byte-buddy:1.14.8' + testImplementation 'org.mockito:mockito-core:5.7.0' + testImplementation 'org.objenesis:objenesis:3.3' } -version = '1.3' +version = '1.4-SNAPSHOT' group = 'com.xlson.groovycsv' sourceSets { @@ -95,3 +100,7 @@ def isSetupForDeployToMavenCentral() { } // TODO: Update to use maven-publish plugin syntax + +test { + useJUnitPlatform() +}