Repository navigation
Implement base changes #1
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
base: master
Are you sure you want to change the base?
Changes from all commits
d9a94c7
c3d8df6
03cd0e7
252ccf7
beb86f8
e98eaf3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| name: Trigger Bot Merge | ||
| on: | ||
| pull_request: | ||
| permissions: | ||
| pull-requests: write | ||
| contents: write | ||
| jobs: | ||
| call-auto-merge: | ||
| uses: gvatsal60/.github/.github/workflows/bot-pr-auto-approve-merge.yaml@08d0834f1b687dbab5353c7fb066d6b938699609 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| name: CI | ||
| on: | ||
| push: | ||
| branches: [master] | ||
| pull_request: | ||
| permissions: | ||
| contents: read | ||
| jobs: | ||
| test: | ||
| name: Unit Tests (JDK ${{ matrix.java-version }}) | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| java-version: ['11', '17', '21'] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| - name: Set up JDK ${{ matrix.java-version }} | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: ${{ matrix.java-version }} | ||
| distribution: 'temurin' | ||
| - name: Cache Gradle packages | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.gradle/caches | ||
| ~/.gradle/wrapper | ||
| key: ${{ runner.os }}-gradle-${{ matrix.java-version }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-gradle-${{ matrix.java-version }}- | ||
| ${{ runner.os }}-gradle- | ||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
| - name: Run tests | ||
| run: ./gradlew test | ||
| - name: Upload test results | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: test-results-jdk${{ matrix.java-version }} | ||
| path: build/reports/tests/ | ||
| - name: Upload coverage report | ||
| if: matrix.java-version == '17' | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: coverage-report | ||
| path: build/reports/jacoco/ | ||
| - name: Coverage summary | ||
| if: matrix.java-version == '17' | ||
| run: | | ||
| if [ -f build/reports/jacoco/test/jacocoTestReport.csv ]; then | ||
| echo "## Coverage Summary" >> "$GITHUB_STEP_SUMMARY" | ||
| echo '```' >> "$GITHUB_STEP_SUMMARY" | ||
| head -1 build/reports/jacoco/test/jacocoTestReport.csv >> "$GITHUB_STEP_SUMMARY" | ||
| tail -n +2 build/reports/jacoco/test/jacocoTestReport.csv | awk -F',' '{printf "%-40s %s/%s (%.1f%%)\n", $3, $8+$9, $4+$5+$6+$7+$8+$9, ($8+$9)/($4+$5+$6+$7+$8+$9)*100}' >> "$GITHUB_STEP_SUMMARY" | ||
| echo '```' >> "$GITHUB_STEP_SUMMARY" | ||
| fi | ||
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.x' | ||
| - name: Cache pre-commit hooks | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/pre-commit | ||
| key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | ||
| restore-keys: ${{ runner.os }}-pre-commit- | ||
| - name: Install pre-commit | ||
| run: pip install pre-commit | ||
|
Check warning on line 77 in .github/workflows/ci.yaml
|
||
| - name: Run pre-commit hooks | ||
| run: pre-commit run --all-files | ||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| name: Release | ||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| permissions: | ||
| contents: write | ||
|
Check warning on line 7 in .github/workflows/release.yaml
|
||
| jobs: | ||
| test: | ||
| name: Validate Release | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
| - name: Cache Gradle packages | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.gradle/caches | ||
| ~/.gradle/wrapper | ||
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
| restore-keys: ${{ runner.os }}-gradle- | ||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
| - name: Run tests | ||
| run: ./gradlew test | ||
| - name: Upload test results | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: test-results | ||
| path: build/reports/tests/ | ||
| release: | ||
| name: Create Release | ||
| needs: test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Extract version from tag | ||
| id: version | ||
| run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" | ||
| - name: Validate library.json version matches tag | ||
| run: | | ||
| LIB_VERSION=$(grep -o '"version": *"[^"]*"' resources/org/devops/library.json | grep -o '[0-9][^"]*') | ||
| TAG_VERSION="${{ steps.version.outputs.VERSION }}" | ||
| if [ "$LIB_VERSION" != "$TAG_VERSION" ]; then | ||
| echo "::warning::library.json version ($LIB_VERSION) does not match tag version ($TAG_VERSION)" | ||
| fi | ||
| - name: Generate changelog | ||
| id: changelog | ||
| run: | | ||
| # Get the previous tag | ||
| PREV_TAG=$(git tag --sort=-v:refname | grep '^v' | head -2 | tail -1) | ||
| if [ -z "$PREV_TAG" ] || [ "$PREV_TAG" = "$GITHUB_REF_NAME" ]; then | ||
| echo "CHANGELOG<<EOF" >> "$GITHUB_OUTPUT" | ||
| git log --pretty=format:"- %s (%h)" HEAD >> "$GITHUB_OUTPUT" | ||
| echo "" >> "$GITHUB_OUTPUT" | ||
| echo "EOF" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "CHANGELOG<<EOF" >> "$GITHUB_OUTPUT" | ||
| git log --pretty=format:"- %s (%h)" "${PREV_TAG}..HEAD" >> "$GITHUB_OUTPUT" | ||
| echo "" >> "$GITHUB_OUTPUT" | ||
| echo "EOF" >> "$GITHUB_OUTPUT" | ||
| fi | ||
| - name: Create GitHub Release | ||
| uses: softprops/action-gh-release@v2 | ||
|
|
||
| with: | ||
| tag_name: ${{ github.ref_name }} | ||
| name: Release ${{ github.ref_name }} | ||
| body: | | ||
| ## Changes | ||
|
|
||
| ${{ steps.changelog.outputs.CHANGELOG }} | ||
|
|
||
| ## Usage | ||
|
|
||
| ```groovy | ||
| @Library('devops-shared@${{ github.ref_name }}') _ | ||
| ``` | ||
| generate_release_notes: true | ||
| draft: false | ||
| prerelease: ${{ contains(steps.version.outputs.VERSION, '-') }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 MEDIUM RISK
Suggestion: Piping an external script directly from curl to sh is a security risk. Consider downloading the script, verifying its checksum, and then executing it locally.