Skip to content

Build(deps): Bump actions/upload-artifact from 4 to 5 #158

Build(deps): Bump actions/upload-artifact from 4 to 5

Build(deps): Bump actions/upload-artifact from 4 to 5 #158

Workflow file for this run

name: Test Action
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches: trunk
paths:
- '.env'
- 'docker-compose.yml'
- '**test.yml'
pull_request:
branches: trunk
paths:
- '.env'
- 'docker-compose.yml'
- 'Dockerfile'
- 'entrypoint.sh'
- '**test.yml'
env:
VERSION: container-test
jobs:
test-rmw:
env:
REGISTRY_IMAGE: andy5995/linuxdeploy
TAG: v3-jammy
DOCKER_CACHE_DEST: ${{ github.workspace }}/.docker/buildx-cache-${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-24.04-arm
- ubuntu-24.04
runs-on: ${{ matrix.os }}
steps:
- name: Checkout rmw
uses: actions/checkout@v4
with:
repository: theimpossibleastronaut/rmw
- name: Set variables
run: |
if [ -z "$VERSION" ]; then
echo "VERSION=${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Checkout
uses: actions/checkout@v4
with:
path: _linuxdeploy_test
fetch-depth: 0
- name: Check if Dockerfile or entrypoint.sh has changed
run: |
if [ "${{ github.ref }}" != "refs/heads/trunk" ]; then
cd _linuxdeploy_test
FILES=$(git log -1 -p ./ | grep +++ | cut -d '/' -f 2-| sed -e 's|dev/null||g')
if echo "$FILES" | grep -qE "^(Dockerfile)$"; then
echo "do_build=true" >> $GITHUB_ENV
else
echo "do_build=false" >> $GITHUB_ENV
fi
else
# If there was a push to trunk, we don't want the docker build
# to run. All the builds in docker.yml will be pushed when *that*
# workflow runs, so we really don't want to be adding extra builds
# that won't become "permanent".
# Theoretically, if a new Dockerfile is pushed to master, it should
# already have been tested anyway.
#
# That may mean the test will fail if the images don't exist yet
# in the registry or there was a dramatic change in the Dockerfile
# that might break the test that runs via docker compose.
# That's ok for now. We'll see how things go...
echo "do_build=false" >> $GITHUB_ENV
fi
- name: Cache Docker layers
if: ${{ env.do_build == 'true' }}
id: docker-cache
uses: actions/cache@v4
with:
path: ${{ env.DOCKER_CACHE_DEST }}
key: ${{ runner.os }}-docker-${{ matrix.os }}-${{ github.ref_name }}
restore-keys: |
${{ runner.os }}-docker-${{ matrix.os }}-
${{ runner.os }}-docker-
- name: Set up Docker Buildx
if: ${{ env.do_build == 'true' }}
uses: docker/setup-buildx-action@v3
- name: Build Docker image
if: ${{ env.do_build == 'true' }}
run: |
cd _linuxdeploy_test
docker buildx build \
. \
-t ${REGISTRY_IMAGE}:${TAG} \
--build-arg CODENAME=jammy \
--cache-to=type=local,dest=${{ env.DOCKER_CACHE_DEST }} \
--cache-from=type=local,src=${{ env.DOCKER_CACHE_DEST }} \
--load
- name: Build AppImage
run: |
export HOSTUID=$(id -u) HOSTGID=$(id -g)
docker compose -f _linuxdeploy_test/docker-compose.yml run --rm build
env:
SCRIPT: 'packaging/appimage/pre-appimage.sh'
- name: Create sha256sum
run: |
cd out
IMAGE_FILENAME=$(ls *.AppImage)
echo "IMAGE_FILENAME=$IMAGE_FILENAME" >> $GITHUB_ENV
sha256sum "$IMAGE_FILENAME" > "$IMAGE_FILENAME.sha256sum"
- name: Upload AppImage
uses: actions/upload-artifact@v5
with:
name: ${{ env.IMAGE_FILENAME }}
path: ./out/*
if-no-files-found: error