Skip to content

Commit

Permalink
ci(github): split CI job in two for performances improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
Djaytan committed Jan 6, 2024
1 parent 20db59d commit 4122b17
Showing 1 changed file with 47 additions and 11 deletions.
58 changes: 47 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ on:
permissions: {}

jobs:
ci:
name: CI
build-and-test:
name: Build & Test
runs-on: ubuntu-latest

permissions:
actions: read
contents: read
security-events: write

steps:
- name: Harden runner
Expand All @@ -29,8 +27,6 @@ jobs:
egress-policy: block
allowed-endpoints: >
github.com:443
api.github.com:443
uploads.github.com:443
objects.githubusercontent.com:443
repo.maven.apache.org:443
jitpack.io:443
Expand Down Expand Up @@ -74,11 +70,6 @@ jobs:
key: sonar
restore-keys: sonar

- name: Initialize CodeQL
uses: github/codeql-action/init@012739e5082ff0c22ca6d6ab32e07c36df03c4a4 # v3.22.12
with:
languages: java

- name: Maven build & SonarCloud quality scan
env:
GITHUB_TOKEN: ${{ github.token }}
Expand All @@ -93,6 +84,51 @@ jobs:
-Dsonar.organization="${SONAR_ORGANIZATION}" \
-Dsonar.projectKey="${SONAR_PROJECT_KEY}"
security-scan:
name: Security scan
runs-on: ubuntu-latest

permissions:
actions: read
contents: read
security-events: write

steps:
- name: Harden runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
github.com:443
api.github.com:443
uploads.github.com:443
repo.maven.apache.org:443
jitpack.io:443
repo.papermc.io:443
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false

- name: Set up JDK 17
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
with:
java-version: 17
distribution: temurin
cache: maven

- name: Initialize CodeQL
uses: github/codeql-action/init@012739e5082ff0c22ca6d6ab32e07c36df03c4a4 # v3.22.12
with:
languages: java

- name: Build
run: |
mvn package --activate-profiles fast \
--batch-mode --errors --strict-checksums --update-snapshots --fail-fast
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@012739e5082ff0c22ca6d6ab32e07c36df03c4a4 # v3.22.12
with:
Expand Down

0 comments on commit 4122b17

Please sign in to comment.