Prep for v3 #124
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: | |
| runs-on: ubuntu-latest | |
| env: | |
| REGISTRY_IMAGE: andy5995/linuxdeploy:v3-focal | |
| strategy: | |
| matrix: | |
| platform: | |
| - linux/amd64 | |
| - linux/arm64 | |
| steps: | |
| - name: Checkout rmw | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: theimpossibleastronaut/rmw | |
| - if: ${{ ! contains(matrix.platform, 'amd64') }} | |
| uses: docker/setup-qemu-action@v3 | |
| - 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: | | |
| 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 "changed=true" >> $GITHUB_ENV | |
| else | |
| echo "changed=false" >> $GITHUB_ENV | |
| fi | |
| - name: Set up Docker Buildx | |
| if: ${{ env.changed == 'true' }} | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Docker image | |
| if: ${{ env.changed == 'true' }} | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./_linuxdeploy_test | |
| file: ./_linuxdeploy_test/Dockerfile | |
| platforms: ${{ matrix.platform }} | |
| cache-from: type=gha | |
| cache-to: type=gha | |
| tags: $REGISTRY_IMAGE | |
| - name: Install docker-compose | |
| run: | | |
| #sudo apt update | |
| #sudo apt upgrade -y | |
| sudo apt install -y docker-compose | |
| - 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' | |
| PLATFORM: ${{ matrix.platform }} | |
| - name: Create sha256sum | |
| run: | | |
| IMAGE_FILENAME=$(basename `find out/*AppImage`) | |
| echo "IMAGE_FILENAME=$IMAGE_FILENAME" >> $GITHUB_ENV | |
| cd out | |
| sha256sum "$IMAGE_FILENAME" > "$IMAGE_FILENAME.sha256sum" | |
| - name: Upload AppImage | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.IMAGE_FILENAME }} | |
| path: ./out/* | |
| if-no-files-found: error |