-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI workflows for main branch and tags (#20)
* update container registry and name in scripts and config * remove elbe files and tests, no longer used * add workflow for main branch, with robot tests and log upload * add automated workflow to publish on tagging * review finding: use yq, not awk --------- Co-authored-by: Anton Jahn <[email protected]>
- Loading branch information
Showing
35 changed files
with
139 additions
and
1,110 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Build and test image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
cache: "pip" | ||
- run: pip install -r requirements.txt | ||
|
||
- run: env | ||
- run: ./builder/build_container | ||
- run: ./tests/run_tests | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: robot-test-log | ||
path: tests/log.html |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Automated build, test and publish image for tag | ||
|
||
on: | ||
push: | ||
tags: ["v*.*.*"] | ||
|
||
jobs: | ||
build-test-publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Log in to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Compare version and tag name | ||
run: | | ||
VERSION=$(yq -r .Version configuration/build_config.yaml) | ||
TAG_NAME=$(echo "${{ github.ref_name }}" | sed 's/refs\/tags\///') | ||
if [ "${VERSION}" != "${TAG_NAME}" ]; then | ||
echo "Version in build_config.yaml (${VERSION}) does not match tag name (${TAG_NAME})" | ||
exit 1 | ||
fi | ||
- name: Setup python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
cache: "pip" | ||
- run: pip install -r requirements.txt | ||
|
||
- run: ./builder/build_container | ||
- run: ./tests/run_tests | ||
- run: ./builder/publish_container |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
if [ -z $RUNNER ]; then | ||
# docker or podman | ||
RUNNER="docker" | ||
fi | ||
|
||
echo "RUNNER: ${RUNNER}" | ||
|
||
GIT_ROOT=$(git rev-parse --show-toplevel) | ||
|
||
VERSION=${1:-$(yq -r .Version ${GIT_ROOT}/configuration/build_config.yaml)} | ||
CONTAINER_NAME=$(yq -r '.["Base-Name"]' ${GIT_ROOT}/configuration/build_config.yaml) | ||
REPO_NAME=$(yq -r .Repository ${GIT_ROOT}/configuration/build_config.yaml) | ||
|
||
echo "Publishing dev container ${VERSION}" | ||
|
||
set -e | ||
$RUNNER push "${REPO_NAME}/${CONTAINER_NAME}:${VERSION}" |
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.