yifan-c commented on code in PR #59:
URL:
https://github.com/apache/cassandra-easy-stress/pull/59#discussion_r2508748749
##########
.github/workflows/ci.yml:
##########
@@ -0,0 +1,126 @@
+name: CI
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ timeout-minutes: 30
+
+ strategy:
+ matrix:
+ java: [17, 21]
Review Comment:
Why leaving out java 11? gradle-publish-main-release.yml is using 11 to
create releases, although the wf is disabled. I am not fully aware of the
context here.
##########
.github/workflows/ci.yml:
##########
@@ -0,0 +1,126 @@
+name: CI
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ timeout-minutes: 30
+
+ strategy:
+ matrix:
+ java: [17, 21]
+ test-task: ["test40", "test41", "test50"]
+ fail-fast: false
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Set up JDK ${{ matrix.java }}
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ matrix.java }}
+ distribution: "temurin"
+
+ - name: Setup Gradle
+ uses: gradle/actions/setup-gradle@v3
+
+ - name: Run tests (${{ matrix.test-task }})
+ run: ./gradlew ${{ matrix.test-task }}
+
+ lint:
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@v4
+ with:
+ java-version: 17
+ distribution: "temurin"
+
+ - name: Setup Gradle
+ uses: gradle/actions/setup-gradle@v3
+
+ - name: Run ktlint
+ run: ./gradlew ktlintCheck
+
+ detekt:
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@v4
+ with:
+ java-version: 17
+ distribution: "temurin"
+
+ - name: Setup Gradle
+ uses: gradle/actions/setup-gradle@v3
+
+ - name: Run detekt
+ run: ./gradlew detekt
+
+ kover:
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@v4
+ with:
+ java-version: 17
+ distribution: "temurin"
+
+ - name: Setup Gradle
+ uses: gradle/actions/setup-gradle@v3
+
+ - name: Run tests and generate coverage
+ run: ./gradlew test koverXmlReport -x test40 -x test41 -x test50
+
+ build:
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ needs: [test, lint, detekt, kover]
+ if: github.ref == 'refs/heads/main'
Review Comment:
Should the `build` step be part of CI too? If so, we can move the condition
to `Upload build artifact` to build but not upload artifacts in each PR.
##########
.github/workflows/ci.yml:
##########
@@ -0,0 +1,126 @@
+name: CI
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ timeout-minutes: 30
Review Comment:
nit: declare the job permissions explicitly.
I am thinking of the following for the `test` job. Please run with Claude to
update the other jobs.
```yaml
test:
...
permissions:
contents: read # Checkout code
```
(for context, I recently did a similar change to apply the least privilege
principle in another repo)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]