-
Notifications
You must be signed in to change notification settings - Fork 0
Infra/ci refactoring #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infra/ci refactoring #177
Changes from 3 commits
1b69e08
e6de466
2532847
ab882e7
315f17d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,40 @@ | ||||||||||||||||||||||||||||||||||
| name: 'Setup Android Environment' | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| runs: | ||||||||||||||||||||||||||||||||||
| using: "composite" | ||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||
| - name: Setup JDK 21 | ||||||||||||||||||||||||||||||||||
| uses: actions/setup-java@v4 | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| java-version: '21' | ||||||||||||||||||||||||||||||||||
| distribution: 'temurin' | ||||||||||||||||||||||||||||||||||
| cache: gradle | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Setup Android SDK | ||||||||||||||||||||||||||||||||||
| uses: android-actions/setup-android@v3 | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Cache Gradle Wrapper | ||||||||||||||||||||||||||||||||||
| uses: actions/cache@v4 | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| path: ~/.gradle/wrapper | ||||||||||||||||||||||||||||||||||
| key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | ||||||||||||||||||||||||||||||||||
| restore-keys: | | ||||||||||||||||||||||||||||||||||
| ${{ runner.os }}-gradle-wrapper- | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Cache Build Cache | ||||||||||||||||||||||||||||||||||
| uses: actions/cache@v4 | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| path: ~/.gradle/caches/build-cache-1 | ||||||||||||||||||||||||||||||||||
| key: ${{ runner.os }}-build-cache-${{ hashFiles('**/build.gradle*', '**/gradle-wrapper.properties') }}-${{ github.sha }} | ||||||||||||||||||||||||||||||||||
| restore-keys: | | ||||||||||||||||||||||||||||||||||
| ${{ runner.os }}-build-cache-${{ hashFiles('**/build.gradle*', '**/gradle-wrapper.properties') }} | ||||||||||||||||||||||||||||||||||
| ${{ runner.os }}-build-cache- | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+25
to
+32
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Build-cache primary key includes Because Suggested key strategy path: ~/.gradle/caches/build-cache-1
- key: ${{ runner.os }}-build-cache-${{ hashFiles('**/build.gradle*', '**/gradle-wrapper.properties') }}-${{ github.sha }}
+ key: ${{ runner.os }}-build-cache-${{ hashFiles('**/build.gradle*', '**/gradle-wrapper.properties') }}-${{ github.ref_name }}
restore-keys: |
${{ runner.os }}-build-cache-${{ hashFiles('**/build.gradle*', '**/gradle-wrapper.properties') }}
${{ runner.os }}-build-cache-If the 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Generate local.properties | ||||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||
| echo '${{ env.LOCAL_PROPERTIES }}' | base64 -d > ./local.properties | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+34
to
+37
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid inlining secret into shell via Interpolating Proposed fix - name: Generate local.properties
shell: bash
run: |
- echo '${{ env.LOCAL_PROPERTIES }}' | base64 -d > ./local.properties
+ printf '%s' "$LOCAL_PROPERTIES" | base64 -d > ./local.propertiesNote: since this is a composite action, 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Grant execute permission for gradlew | ||||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||||
| run: chmod +x gradlew | ||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: unit-test | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths-ignore: | ||
| - '**.md' | ||
|
|
||
| run-name: "unit-test by ${{ github.actor }}" | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| actions: write | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| jobs: | ||
| unit-test: | ||
| runs-on: ubuntu-latest | ||
| if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} | ||
| timeout-minutes: 30 | ||
|
|
||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/setup-android | ||
| env: | ||
| LOCAL_PROPERTIES: ${{ secrets.LOCAL_PROPERTIES }} | ||
|
|
||
| - name: Run Unit Tests and Record Screenshots | ||
| id: test | ||
| run: ./gradlew testDebugUnitTest --parallel --stacktrace | ||
|
|
||
| - name: Upload Test Reports and Screenshots | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: test-reports | ||
| path: | | ||
| **/build/reports/tests | ||
| **/build/outputs/roborazzi | ||
| retention-days: 7 | ||
|
Comment on lines
+30
to
+42
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider The Proposed fix - name: Post Roborazzi Comment
- if: github.event_name == 'pull_request'
+ if: always() && github.event_name == 'pull_request'
uses: takahirom/roborazzi-comment-action@v1🤖 Prompt for AI Agents |
||
|
|
||
| - name: Post Roborazzi Comment | ||
| if: github.event_name == 'pull_request' | ||
| uses: takahirom/roborazzi-comment-action@v1 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| comment-identifier: "roborazzi-report" | ||
| report-dir: "**/build/outputs/roborazzi" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pin third-party action to a commit SHA.
uses: takahirom/roborazzi-comment-action@<full-40-char-sha> # v1.x.y🤖 Prompt for AI Agents |
||
Uh oh!
There was an error while loading. Please reload this page.