Cache APT Packages (#3255)

This saves ~2 mins from the "Install dependencies" step when testing new AppImages.
This commit is contained in:
Jack Greiner authored and GitHub committed 2023-09-11 23:10:00 +02:00
1 parent af38c5f45a
commit ab9ab288be
1 file changed
+12 -5
+12 -5
View File
@@ -29,13 +29,20 @@ jobs:
# providing a fetch-depth of 0 should fetch all history.
with:
fetch-depth: 0
- name: Configure APT Packages
uses: awalsh128/[email protected]
# This action handles caching APT packages, and leaves the option for package configuration scripts to be run if needed,
# saving a boat-load of time, if needed bump the action version.
with:
packages: sudo imagemagick libasound2-dev pulseaudio-utils alsa-utils alsa-oss libjack0 desktop-file-utils xmlstarlet xsel xterm xvfb icewm x11-utils x11-apps netpbm xdotool libgl1-mesa-dri libgl1-mesa-dev mesa-utils libosmesa6 libsdl1.2-dev libsdl2-2.0-0 fonts-wqy-microhei libfile-mimeinfo-perl
version: 1.0
# Bump me ^ if you have added any new packages
- name: Install dependencies
shell: bash
run: |
# set -e
sudo apt update
sudo apt-get -qq -y install sudo imagemagick libasound2-dev pulseaudio-utils alsa-utils alsa-oss libjack0 desktop-file-utils xmlstarlet xterm xvfb icewm x11-utils x11-apps netpbm xdotool libgl1-mesa-dri libgl1-mesa-dev mesa-utils libosmesa6 libsdl1.2-dev libsdl2-2.0-0 fonts-wqy-microhei libfile-mimeinfo-perl # appstream # TODO: Cache me!
sudo bash code/prep-dummy-soundcard.sh
# TODO Cache gem and npm packages
sudo gem install dupervisor -v 1.0.5 # To convert ini to yaml files
sudo npm install -g asar # to get pacakges.json from resources/app.asar for electron-builder applications
# npm install -g @alexlafroscia/yaml-merge # to merge yaml files
@@ -93,14 +100,14 @@ jobs:
echo "SCREENSHOT_URL: ${SCREENSHOT_URL}" || true
- name: Post Screenshot URL
if: ${{ always() && github.event_name == 'pull_request' && github.run_status != 'cancelled' }}
uses: actions/github-script@v4
uses: actions/github-script@v6
with:
script: |
const prNumber = context.payload.pull_request.number;
const screenshotURL = process.env.SCREENSHOT_URL;
if (screenshotURL) {
const commentBody = `Seems like the test succeeded. Temporary screenshot URL: ${screenshotURL}`;
await github.issues.createComment({
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
@@ -109,7 +116,7 @@ jobs:
} else {
const runURL = `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${{ github.run_id }}`;
const commentBody = `The test was unable to make a screenshot. Most likely, the test did not succeed. Please check the [logs of the test run](${runURL}).`;
await github.issues.createComment({
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,