Skip to content

Commit

Permalink
Merge pull request #2810 from rsksmart/scorecard
Browse files Browse the repository at this point in the history
Scorecard
  • Loading branch information
Vovchyk authored Oct 23, 2024
2 parents 526931c + 611613e commit 02adb83
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 42 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily

# Maintain dependencies for Docker
- package-ecosystem: docker
directory: /
schedule:
interval: daily
57 changes: 30 additions & 27 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ on:
branches:
- "**"

# Declare default permissions as read only.
permissions: read-all

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #v4.2.1

- name: Setup Java & Gradle
uses: actions/setup-java@v4
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 #v4.4.0
with:
java-version: '17'
distribution: 'temurin'
Expand All @@ -28,7 +31,7 @@ jobs:
curl -sSL https://secchannel.rsk.co/SUPPORT.asc | gpg2 --import -
gpg2 --verify SHA256SUMS.asc && sha256sum --check SHA256SUMS.asc
- uses: actions/cache@v4
- uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 #v4.1.1
name: Cache Gradle Wrapper
id: cache-gradle-wrapper
with:
Expand All @@ -46,7 +49,7 @@ jobs:
./gradlew --no-daemon --stacktrace build -x test
- name: Archive build artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 #v4.4.3
with:
name: build-files
path: |
Expand All @@ -56,18 +59,18 @@ jobs:
needs: unit-tests-java17
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #v4.2.1
with:
fetch-depth: 0

- name: Setup Java & Gradle
uses: actions/setup-java@v4
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 #v4.4.0
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- uses: actions/cache/restore@v4
- uses: actions/cache/restore@3624ceb22c1c5a301c8db4169662070a689d9ea8 #v4.1.1
name: Restore Gradle Wrapper
with:
path: |
Expand All @@ -76,21 +79,21 @@ jobs:
fail-on-cache-miss: true

- name: Download build artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 #v4.1.8
with:
name: build-files
path: |
rskj-core/build
- name: Download test results
uses: actions/download-artifact@v4
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 #v4.1.8
with:
name: test-results
path: |
rskj-core/build/test-results/
- name: Download test reports
uses: actions/download-artifact@v4
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 #v4.1.8
with:
name: test-reports
path: |
Expand Down Expand Up @@ -153,17 +156,17 @@ jobs:
options: --name bitcoind2
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #v4.2.1

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 #v4.0.4
with:
node-version: '12.x'
- name: Check Node.js version
run: node --version

- name: Checkout Mining Integration Tests Repository
uses: actions/checkout@v4
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #v4.2.1
with:
repository: rsksmart/mining-integration-tests
ref: ${{ secrets.MINING_INTEGRATION_TESTS_REF }}
Expand All @@ -186,13 +189,13 @@ jobs:
node --unhandled-rejections=strict generateBtcBlocks.js
- name: Setup Java & Gradle
uses: actions/setup-java@v4
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 #v4.4.0
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- uses: actions/cache/restore@v4
- uses: actions/cache/restore@3624ceb22c1c5a301c8db4169662070a689d9ea8 #v4.1.1
name: Restore Gradle Wrapper
with:
path: |
Expand All @@ -201,7 +204,7 @@ jobs:
fail-on-cache-miss: true

- name: Download build artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 #v4.1.8
with:
name: build-files
path: |
Expand Down Expand Up @@ -236,16 +239,16 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #v4.2.1

- name: Setup Java & Gradle
uses: actions/setup-java@v4
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 #v4.4.0
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- uses: actions/cache/restore@v4
- uses: actions/cache/restore@3624ceb22c1c5a301c8db4169662070a689d9ea8 #v4.1.1
name: Restore Gradle Wrapper
with:
path: |
Expand All @@ -258,14 +261,14 @@ jobs:
./gradlew --no-daemon --stacktrace test
- name: Persist test results for sonar
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 #v4.4.3
with:
name: test-results
path: |
rskj-core/build/test-results/
- name: Persist test reports for sonar
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 #v4.4.3
with:
name: test-reports
path: |
Expand All @@ -275,16 +278,16 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #v4.2.1

- name: Setup Java & Gradle
uses: actions/setup-java@v4
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 #v4.4.0
with:
java-version: '21'
distribution: 'temurin'
cache: 'gradle'

- uses: actions/cache/restore@v4
- uses: actions/cache/restore@3624ceb22c1c5a301c8db4169662070a689d9ea8 #v4.1.1
name: Restore Gradle Wrapper
with:
path: |
Expand All @@ -300,16 +303,16 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #v4.2.1

- name: Setup Java & Gradle
uses: actions/setup-java@v4
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 #v4.4.0
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- uses: actions/cache/restore@v4
- uses: actions/cache/restore@3624ceb22c1c5a301c8db4169662070a689d9ea8 #v4.1.1
name: Restore Gradle Wrapper
with:
path: |
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ on:
schedule:
- cron: "0 0 * * *"

# Declare default permissions as read only.
permissions: read-all

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
Expand All @@ -24,11 +25,11 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #v4.2.1

- name: Setup Java JDK
if: ${{ matrix.language == 'java' }}
uses: actions/setup-java@v3
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 #v4.4.0
with:
java-version: '17'
distribution: 'temurin'
Expand All @@ -38,15 +39,15 @@ jobs:
run: ./configure.sh

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@f779452ac5af1c261dce0346a8f964149f49322b #v3.26.13
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v3
uses: github/codeql-action/autobuild@f779452ac5af1c261dce0346a8f964149f49322b #v3.26.13

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@f779452ac5af1c261dce0346a8f964149f49322b #v3.26.13
with:
category: "/language:${{ matrix.language }}"
20 changes: 20 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Dependency Review'
on: [pull_request]

permissions: read-all

jobs:
dependency-review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: 'Checkout Repository'
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1

- name: 'Dependency Review'
uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4
with:
fail-on-severity: high
comment-summary-in-pr: true
11 changes: 7 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ on:
tags:
- '*'

# Declare default permissions as read only.
permissions: read-all

jobs:
docker:
runs-on: ubuntu-20.04

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #v4.2.1

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 #v5.5.1
with:
images: rsksmart/rskj
tags: |
Expand All @@ -28,13 +31,13 @@ jobs:
type=match,pattern=(\w+-\d+)\.\d+\.\d+.*,group=1
- name: DockerHub login
uses: docker/login-action@v2
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 #v6.9.0
with:
context: .
push: true
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/rit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ on:
required: false
default: 'master'

# Declare default permissions as read only.
permissions: read-all

jobs:
rootstock-integration-tests:
name: Rootstock Integration Tests
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout Repository # Step needed to access the PR description using github CLI
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #v4.2.1

- name: Set Branch Variables
id: set-branch-variables
Expand Down
Loading

0 comments on commit 02adb83

Please sign in to comment.