Skip to content

fix(ci-container): upload log on failure #5795

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop-6.x.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 27 additions & 7 deletions .github/workflows/ci-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
name: Deploy
on: [push, pull_request]
on:
push:
pull_request:
schedule:
- cron: "0 6 * * *"
workflow_dispatch:

jobs:
build:
name: Build and Test Images
runs-on: ubuntu-latest
# NOTE (DP): Publish on develop and master, test on PRs against these
# TODO(DP) Reinstate CRONed release builds to update stock apps regularly
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/develop-6.x.x' || github.ref == 'refs/heads/master'|| github.base_ref == 'develop' || github.base_ref == 'develop-6.x.x' || github.base_ref == 'master'
steps:
- uses: actions/checkout@v4
Expand All @@ -19,7 +24,7 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64
- name: Make buildkit default
uses: docker/setup-buildx-action@v3
id: buildx
Expand All @@ -32,20 +37,36 @@ jobs:
key: deploy-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: deploy-${{ runner.os }}-maven
- name: Install bats
run: sudo apt-get install bats
run: sudo apt-get install bats
- name: Build images
run: mvn -V -B -q -Pdocker -DskipTests -Ddependency-check.skip=true -P !mac-dmg-on-unix,!installer,!concurrency-stress-tests,!micro-benchmarks,skip-build-dist-archives clean package
- name: Check local images
run: docker image ls
- name: Check license headers
run: mvn license:check
working-directory: exist-docker
working-directory: exist-docker
- name: Start exist-ci container
run: |
docker run -dit -p 8080:8080 --name exist-ci --rm existdb/existdb:latest
sleep 35s
- name: Run tests
run: bats --tap exist-docker/src/test/bats/*.bats
- name: debug logs
if: failure()
run: docker logs exist-ci | grep 'ERROR'

- name: Copy logs on failure
if: failure()
run: |
echo "Copying logs..."
docker cp exist-ci:/exist/logs/exist.log ./exist.log

- name: Upload logs artifact
if: failure()
uses: actions/upload-artifact@v4
with:
name: exist-core-failed-${{ github.ref }}-log
path: exist.log
# NOTE (DP): When on master push release, when on develop push latest: Version is included automatically
# TODO (DP): Confirm that releases triggered from maven publish images with the non SNAPSHOT version
- name: Publish latest images
Expand Down Expand Up @@ -80,5 +101,4 @@ jobs:
# DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
# run: mvn -q -Ddocker.tag=experimental6 -Ddocker.username=$DOCKER_USERNAME -Ddocker.password=$DOCKER_PASSWORD docker:build docker:push
# working-directory: ./exist-docker

# working-directory: ./exist-docker
Loading