Skip to content

Commit

Permalink
re-order steps of workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
leiicamundi committed Feb 26, 2024
1 parent aaaff89 commit a8ce0c0
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 99 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/01-build-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
# desc: build container images, perform static tests then push

name: build-images

on:
push:

env:
SHOULD_WE_PUSH: false

# for the build and test phases, we use local ghcr.io registry, when the image is qualitified, it will be published to the
# docker.io registry in the publish-image workflow
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install if required common software tooling
uses: camunda/infra-global-github-actions/common-tooling@main
with:
java-enabled: false
yarn-enabled: false

# TODO: integrate QEMU in standard tooling
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3

- name: Build image using Camunda docker build
uses: camunda/infra-global-github-actions/build-docker-image@main
with:
registry_host: ${{ env.REGISTRY }}
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
image_name: camunda/keycloak-aws
#extra_tags: # TODO: add commit version
#build_args: # TODO: integrate commit infos etc
build_context: .
# TODO: modify this one to integrate "platforms"
#build_platforms: linux/amd64,linux/arm64
#docker_load: false # TODO: re-enabled, disabled due to a bug on multiarch
63 changes: 63 additions & 0 deletions .github/workflows/30-test-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
# desc: build container images, perform static tests then push

name: test-images

on:
push:

workflow_run:
workflows: ["build-images"]
types:
- completed

jobs:
test-base-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install if required common software tooling
uses: camunda/infra-global-github-actions/common-tooling@main
with:
java-enabled: false
yarn-enabled: false

- name: KeyCloak Show-Config
run: |
docker run camunda/keycloak-aws:latest show-config >> docker.log
echo "config=$(cat docker.log | tr '\n' ' ')" >> "$GITHUB_ENV"
- name: Assert Config
env:
CONFIG: ${{ env.config }}
run: python3 ./.github/scripts/build-check/main.py

test-postgres-integ:
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install if required common software tooling
uses: camunda/infra-global-github-actions/common-tooling@main
with:
java-enabled: false
yarn-enabled: false


- name: Start Test Environment
uses: ./.github/actions/compose
with:
compose_file: ${{ github.workspace }}/docker-compose.yml
project_name: keycloak
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./.github/scripts/integration/requirements.txt
- name: Test Environment
run: python3 ./.github/scripts/integration/main.py

# TODO: add tests (static framework tbd) then push
19 changes: 19 additions & 0 deletions .github/workflows/90-publish-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: publish-images
on:
push:
branches:
- main

workflow_run:
workflows: ["test-images"]
types:
- completed

jobs:
publish-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
-
54 changes: 0 additions & 54 deletions .github/workflows/build-images.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/integration-postgresql.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/pre-commit.yml

This file was deleted.

0 comments on commit a8ce0c0

Please sign in to comment.