Skip to content

Commit c36f4e5

Browse files
authored
ci: add Dependabot and trim caches and artifacts (#304)
Add weekly Dependabot version updates for the GitHub Actions, including the composite actions, and for Maven, grouped into one PR per ecosystem. The FFmpeg submodule and the WebRTC branch stay manual. Share one Maven cache per OS instead of one per platform, and keep the project's own artifacts, which mvn deploy installs, out of it. The eight caches of 100-150 MB each were rewritten on every pom change. Keep the natives uploaded for test-natives for one day instead of the default 90, and verify the SHA-512 of the Maven that test-natives downloads.
1 parent 7b8e4e9 commit c36f4e5

7 files changed

Lines changed: 73 additions & 13 deletions

File tree

‎.github/actions/build-macos-x86_64/action.yml‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,17 @@ runs:
5151
key: ffmpeg-${{ env.FFMPEG_VERSION }}-${{ inputs.platform-name }}-${{ hashFiles('webrtc-java-media/src/main/cpp/dependencies/ffmpeg/CMakeLists.txt') }}-${{ hashFiles('webrtc-java-media/pom.xml') }}
5252
restore-keys: ffmpeg-${{ env.FFMPEG_VERSION }}-${{ inputs.platform-name }}-${{ hashFiles('webrtc-java-media/src/main/cpp/dependencies/ffmpeg/CMakeLists.txt') }}-
5353

54+
# One cache per OS: the dependencies do not differ between the platforms of
55+
# an OS. The project's own artifacts, which mvn deploy installs, change with
56+
# every build and stay out of it.
5457
- name: Set up Maven cache
5558
uses: actions/cache@v6
5659
with:
57-
path: ~/.m2/repository
58-
key: maven-${{ inputs.platform-name }}-${{ hashFiles('**/pom.xml') }}
59-
restore-keys: maven-${{ inputs.platform-name }}-
60+
path: |
61+
~/.m2/repository
62+
!~/.m2/repository/dev/onvoid/webrtc
63+
key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
64+
restore-keys: maven-${{ runner.os }}-
6065

6166
# The runner is Apple Silicon. The build runs natively and cross compiles
6267
# for Intel; only the tests need an Intel JVM, to load what was built, and

‎.github/actions/build/action.yml‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,17 @@ runs:
5151
key: ffmpeg-${{ env.FFMPEG_VERSION }}-${{ inputs.platform-name }}-${{ hashFiles('webrtc-java-media/src/main/cpp/dependencies/ffmpeg/CMakeLists.txt') }}-${{ hashFiles('webrtc-java-media/pom.xml') }}
5252
restore-keys: ffmpeg-${{ env.FFMPEG_VERSION }}-${{ inputs.platform-name }}-${{ hashFiles('webrtc-java-media/src/main/cpp/dependencies/ffmpeg/CMakeLists.txt') }}-
5353

54+
# One cache per OS: the dependencies do not differ between the platforms of
55+
# an OS. The project's own artifacts, which mvn deploy installs, change with
56+
# every build and stay out of it.
5457
- name: Set up Maven cache
5558
uses: actions/cache@v6
5659
with:
57-
path: ~/.m2/repository
58-
key: maven-${{ inputs.platform-name }}-${{ hashFiles('**/pom.xml') }}
59-
restore-keys: maven-${{ inputs.platform-name }}-
60+
path: |
61+
~/.m2/repository
62+
!~/.m2/repository/dev/onvoid/webrtc
63+
key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
64+
restore-keys: maven-${{ runner.os }}-
6065

6166
- name: Set up JDK ${{ inputs.java-version }}
6267
uses: actions/setup-java@v5

‎.github/actions/release-macos-x86_64/action.yml‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,17 @@ runs:
4343
key: ffmpeg-${{ env.FFMPEG_VERSION }}-${{ inputs.platform-name }}-${{ hashFiles('webrtc-java-media/src/main/cpp/dependencies/ffmpeg/CMakeLists.txt') }}-${{ hashFiles('webrtc-java-media/pom.xml') }}
4444
restore-keys: ffmpeg-${{ env.FFMPEG_VERSION }}-${{ inputs.platform-name }}-${{ hashFiles('webrtc-java-media/src/main/cpp/dependencies/ffmpeg/CMakeLists.txt') }}-
4545

46+
# One cache per OS: the dependencies do not differ between the platforms of
47+
# an OS. The project's own artifacts, which mvn deploy installs, change with
48+
# every build and stay out of it.
4649
- name: Set up Maven cache
4750
uses: actions/cache@v6
4851
with:
49-
path: ~/.m2/repository
50-
key: maven-${{ inputs.platform-name }}-${{ hashFiles('**/pom.xml') }}
51-
restore-keys: maven-${{ inputs.platform-name }}-
52+
path: |
53+
~/.m2/repository
54+
!~/.m2/repository/dev/onvoid/webrtc
55+
key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
56+
restore-keys: maven-${{ runner.os }}-
5257

5358
# The runner is Apple Silicon. The build runs natively and cross compiles
5459
# for Intel; only the tests need an Intel JVM, to load what was built, and

‎.github/actions/release/action.yml‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,17 @@ runs:
4242
key: ffmpeg-${{ env.FFMPEG_VERSION }}-${{ inputs.platform-name }}-${{ hashFiles('webrtc-java-media/src/main/cpp/dependencies/ffmpeg/CMakeLists.txt') }}-${{ hashFiles('webrtc-java-media/pom.xml') }}
4343
restore-keys: ffmpeg-${{ env.FFMPEG_VERSION }}-${{ inputs.platform-name }}-${{ hashFiles('webrtc-java-media/src/main/cpp/dependencies/ffmpeg/CMakeLists.txt') }}-
4444

45+
# One cache per OS: the dependencies do not differ between the platforms of
46+
# an OS. The project's own artifacts, which mvn deploy installs, change with
47+
# every build and stay out of it.
4548
- name: Set up Maven cache
4649
uses: actions/cache@v6
4750
with:
48-
path: ~/.m2/repository
49-
key: maven-${{ inputs.platform-name }}-${{ hashFiles('**/pom.xml') }}
50-
restore-keys: maven-${{ inputs.platform-name }}-
51+
path: |
52+
~/.m2/repository
53+
!~/.m2/repository/dev/onvoid/webrtc
54+
key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
55+
restore-keys: maven-${{ runner.os }}-
5156

5257
- name: Set up JDK ${{ inputs.java-version }}
5358
uses: actions/setup-java@v5

‎.github/actions/test-natives/action.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ runs:
6767
- name: Ensure Maven
6868
run: |
6969
if ! command -v mvn >/dev/null 2>&1; then
70-
curl -sSLo maven.zip https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip
70+
url=https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip
71+
curl -sSfLo maven.zip "$url"
72+
echo "$(curl -sSfL "$url.sha512" | cut -d' ' -f1) maven.zip" | sha512sum -c -
7173
unzip -q maven.zip -d "$RUNNER_TEMP/maven"
7274
echo "$RUNNER_TEMP/maven/apache-maven-3.9.9/bin" >> "$GITHUB_PATH"
7375
fi

‎.github/dependabot.yml‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: 2
2+
3+
# Weekly version updates, one grouped PR per ecosystem. Security updates are
4+
# enabled separately in the repository settings and are not affected by this.
5+
#
6+
# The FFmpeg submodule and the WebRTC branch are left out on purpose: each bump
7+
# needs manual follow-up (FFmpeg's library file names and configure options,
8+
# the Chromium Clang pin in prepare-linux), so they are updated by hand.
9+
updates:
10+
- package-ecosystem: github-actions
11+
# Also covers the composite actions under .github/actions.
12+
directories:
13+
- "/"
14+
- "/.github/actions/*"
15+
schedule:
16+
interval: weekly
17+
groups:
18+
github-actions:
19+
patterns: ["*"]
20+
commit-message:
21+
prefix: ci
22+
23+
- package-ecosystem: maven
24+
directory: "/"
25+
schedule:
26+
interval: weekly
27+
groups:
28+
maven-plugins:
29+
patterns: ["org.apache.maven.plugins:*", "*-maven-plugin"]
30+
maven-dependencies:
31+
patterns: ["*"]
32+
commit-message:
33+
prefix: build
34+
include: scope

‎.github/workflows/build.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ jobs:
8181
webrtc-jni/target/webrtc-java-*.jar
8282
webrtc-java-media/target/webrtc-java-media-*.jar
8383
if-no-files-found: error
84+
# Only test-natives of this same run reads them.
85+
retention-days: 1
8486

8587
build-linux:
8688
strategy:
@@ -124,6 +126,8 @@ jobs:
124126
webrtc-jni/target/webrtc-java-*.jar
125127
webrtc-java-media/target/webrtc-java-media-*.jar
126128
if-no-files-found: error
129+
# Only test-natives of this same run reads them.
130+
retention-days: 1
127131

128132
build-macos:
129133
strategy:

0 commit comments

Comments
 (0)