Skip to content

Commit

Permalink
fix: build caching in ci, codeql
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Gammon <sam@elide.ventures>
  • Loading branch information
sgammon committed Feb 14, 2024
1 parent a20da7d commit 58eb3e1
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "CodeQL"

languages: java, javascript
languages: javascript-typescript

queries:
- uses: security-and-quality
Expand All @@ -13,3 +13,5 @@ paths-ignore:
- build
- samples
- tools/plugin
- packages/embedded
- packages/nfi
13 changes: 4 additions & 9 deletions .github/workflows/checks.codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ jobs:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ["javascript-typescript"]
steps:
- name: "Setup: Harden Runner"
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
Expand All @@ -65,6 +61,7 @@ jobs:
uses: github/codeql-action/init@012739e5082ff0c22ca6d6ab32e07c36df03c4a4 # v3.22.12
with:
config-file: ./.github/codeql/codeql-config.yml
fail-on-severity: "error"
- name: "Setup: Artifacts"
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
continue-on-error: true
Expand All @@ -73,6 +70,9 @@ jobs:
- name: "Analysis: Build"
uses: gradle/actions/setup-gradle@v3.1.0
continue-on-error: true
env:
CI: true
BUILDLESS_APIKEY: ${{ secrets.BUILDLESS_APIKEY }}
with:
cache-read-only: true
cache-encryption-key: ${{ secrets.GRADLE_CONFIGURATION_KEY }}
Expand All @@ -85,8 +85,3 @@ jobs:
- name: "Analysis: CodeQL"
uses: github/codeql-action/analyze@012739e5082ff0c22ca6d6ab32e07c36df03c4a4 # v3.22.12
continue-on-error: true
with:
languages: ${{ matrix.language }}
queries: ./.github/codeql/queries
config-file: ./.github/codeql/codeql-config.yml
fail-on-severity: "error"
6 changes: 6 additions & 0 deletions .github/workflows/checks.sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ name: Sonar
BUILDLESS_APIKEY:
description: "Buildless API key"
required: false
GRADLE_CONFIGURATION_KEY:
description: "Gradle cache key"
required: false

permissions:
contents: "read"
Expand Down Expand Up @@ -68,6 +71,9 @@ jobs:
- name: "Analysis: Sonar"
uses: gradle/actions/setup-gradle@v3.1.0
continue-on-error: true
env:
CI: true
BUILDLESS_APIKEY: ${{ secrets.BUILDLESS_APIKEY }}
with:
cache-read-only: true
cache-encryption-key: ${{ secrets.GRADLE_CONFIGURATION_KEY }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/job.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ jobs:
continue-on-error: ${{ matrix.mode == 'labs' }}
env:
CI: true
BUILDLESS_APIKEY: ${{ secrets.BUILDLESS_APIKEY }}
with:
cache-read-only: false
cache-encryption-key: ${{ secrets.GRADLE_CONFIGURATION_KEY }}
Expand Down Expand Up @@ -403,6 +404,7 @@ jobs:
uses: gradle/actions/setup-gradle@v3.1.0
env:
CI: true
BUILDLESS_APIKEY: ${{ secrets.BUILDLESS_APIKEY }}
TEST_EXCEPTIONS: true
with:
cache-read-only: false
Expand Down Expand Up @@ -446,6 +448,7 @@ jobs:
env:
CI: true
TEST_EXCEPTIONS: true
BUILDLESS_APIKEY: ${{ secrets.BUILDLESS_APIKEY }}
with:
cache-read-only: true
cache-encryption-key: ${{ secrets.GRADLE_CONFIGURATION_KEY }}
Expand Down Expand Up @@ -572,6 +575,7 @@ jobs:
continue-on-error: true
env:
CI: true
BUILDLESS_APIKEY: ${{ secrets.BUILDLESS_APIKEY }}
with:
cache-read-only: true
cache-encryption-key: ${{ secrets.GRADLE_CONFIGURATION_KEY }}
Expand Down Expand Up @@ -699,6 +703,7 @@ jobs:
uses: gradle/actions/setup-gradle@v3.1.0
env:
CI: true
BUILDLESS_APIKEY: ${{ secrets.BUILDLESS_APIKEY }}
with:
cache-read-only: true
cache-encryption-key: ${{ secrets.GRADLE_CONFIGURATION_KEY }}
Expand Down Expand Up @@ -847,6 +852,7 @@ jobs:
uses: gradle/actions/setup-gradle@v3.1.0
env:
CI: true
BUILDLESS_APIKEY: ${{ secrets.BUILDLESS_APIKEY }}
with:
cache-read-only: true
cache-encryption-key: ${{ secrets.GRADLE_CONFIGURATION_KEY }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/on.pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ jobs:
if: fromJson(needs.triage.outputs.srcs)
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GRADLE_CONFIGURATION_KEY: ${{ secrets.GRADLE_CONFIGURATION_KEY }}
BUILDLESS_APIKEY: ${{ secrets.BUILDLESS_APIKEY }}
permissions:
contents: "read"
Expand All @@ -231,6 +232,7 @@ jobs:
if: fromJson(needs.triage.outputs.packages)
secrets:
BUILDLESS_APIKEY: ${{ secrets.BUILDLESS_APIKEY }}
GRADLE_CONFIGURATION_KEY: ${{ secrets.GRADLE_CONFIGURATION_KEY }}
permissions:
actions: "read"
contents: "read"
Expand All @@ -247,5 +249,6 @@ jobs:
secrets:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
BUILDLESS_APIKEY: ${{ secrets.BUILDLESS_APIKEY }}
GRADLE_CONFIGURATION_KEY: ${{ secrets.GRADLE_CONFIGURATION_KEY }}
permissions:
contents: "read"
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ val cachePush: String? by settings

buildless {
localCache {
enabled = true
enabled = System.getenv("CI") != "true"
}

remoteCache {
Expand Down

0 comments on commit 58eb3e1

Please sign in to comment.