-
Notifications
You must be signed in to change notification settings - Fork 42
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
Updates to github workflows for PDO #504
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
# This workflow is intended to provide an interactive way of configuring | ||
# PDO tests. Common configuration variables can be set interactively to | ||
# debug differences between local and github. | ||
|
||
name: Run specific PDO tests | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
interpreter: | ||
description: 'Interpreter' | ||
required: true | ||
default: 'wawaka' | ||
type: choice | ||
options: | ||
- wawaka | ||
- wawaka-opt | ||
logLevel: | ||
description: 'Log level' | ||
required: true | ||
default: 'warning' | ||
type: choice | ||
options: | ||
- debug | ||
- info | ||
- warning | ||
memoryConfiguration: | ||
description: 'Interpreter memory configuration' | ||
required: false | ||
default: MEDIUM | ||
type: choice | ||
options: | ||
- SMALL | ||
- MEDIUM | ||
- LARGE | ||
|
||
jobs: | ||
pdo_specific_tests: | ||
name: Run specific PDO tests | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
|
||
- name: Display branch name | ||
run: | | ||
echo "Building branch $GITHUB_HEAD_REF" | ||
echo PDO VERSION is $(bin/get_version) | ||
|
||
- name: Build and run tests | ||
env: | ||
PDO_INTERPRETER: ${{ inputs.interpreter }} | ||
PDO_LOG_LEVEL: ${{ inputs.logLevel }} | ||
PDO_MEMORY_CONFIG: ${{ inputs.memoryConfiguration }} | ||
PDO_DEBUG_BUILD: 1 | ||
run: | | ||
# The creation of a dummy branch is necessary for the CI tests | ||
# to work on PRs. Based on empirical results, in the absence of | ||
# this command, CI tests work on the main branch and on local | ||
# branches. However, they fail as a PR is created. | ||
git checkout -b ci-test-branch | ||
. build/common-config.sh | ||
make -C docker test |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
name: Build and Push PDO Docker Images | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
pull_request: | ||
types: [closed] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before seeing below if, i stumbled over this [closed] and the lack of something like a type [merged]. Googling a bit i found https://github.com/orgs/community/discussions/26724#discussioncomment-3253093 which proposes an arguably simpler solution to achieve the same effect: Oops, i notice the same discussion later also mentions your pattern. I didn't see though any problem with above pattern which still seems moderately simpler/more robust (e.g., you don't have to match other triggers in the if clause ..) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually
I'm going to leave this as is. |
||
branches: [main] | ||
|
||
jobs: | ||
|
||
docker_build: | ||
|
||
if: > | ||
github.event.name == 'workflow_dispatch' || | ||
github.event.name == 'pull_request' && github.event.pull_request.merged == true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now we would generate the dockers for every PR, whether it is a version upgrade or not. But i guess there is no easy way to test whether this is a version upgrade PR? That said, as long as storage is not an issue, i guess there is loittle cost for doing it on all PRs (the actual build should be "free" if github caching works properly as the CI already should have built them?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agree. but remember that the version is updated with every commit. i think there is a question that we need to talk through about when to trigger the action. i don't think this is an unreasonable starting point. i would prefer to get this version working and then come back and address the trigger conditions. |
||
name: Build PDO Images | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
|
||
- name: Display branch name | ||
run: | | ||
echo "Building branch images for $GITHUB_HEAD_REF" | ||
echo PDO VERSION is $(bin/get_version) | ||
echo "PDO_VERSION=$(bin/get_version)" >> $GITHUB_ENV | ||
echo "EVENT NAME: ${{ github.event.name }}" | ||
echo "MERGED: ${{ github.event.pull_request.merged }}" | ||
|
||
- name: Build Docker Images | ||
env: | ||
PDO_INTERPRETER: wawaka | ||
PDO_LOG_LEVEL: warning | ||
run: | | ||
git checkout -b ci-test-branch | ||
. build/common-config.sh | ||
make -C docker | ||
|
||
- name: Login to the ghcr.io Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Tag and push the images | ||
run: | | ||
for image in pdo_services pdo_ccf pdo_client | ||
do | ||
docker image tag ghcr.io/{{ github.repository_owner }}/$image:$PDO_VERSION | ||
docker image tag ghcr.io/{{ github.repository_owner }}/$image:latest | ||
docker image push --all-tags ghcr.io/{{ github.repository_owner }}/$image | ||
done |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,19 @@ | |
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
name: PDO CI | ||
on: [pull_request, push] | ||
# This workflow is intended to be used as a validity test for any | ||
# pull request. That is, this is a minimal functionality that must | ||
# be successfully executed prior to merging a pull request. Note | ||
# that this can be overridden by adding '[skip ci]' in the commit | ||
# name. This should not be done on the main PDO branch. | ||
|
||
name: Run full PDO tests | ||
on: [ pull_request ] | ||
|
||
jobs: | ||
pdo_ci: | ||
pdo_full_tests: | ||
if: "!contains(github.event.commits[0].message, '[skip ci]')" | ||
name: PDO CI Job | ||
name: Run full PDO tests | ||
runs-on: ubuntu-22.04 | ||
|
||
strategy: | ||
|
@@ -25,11 +32,10 @@ jobs: | |
|
||
- name: Display branch name | ||
run: | | ||
echo "Building branch $GITHUB_HEAD_REF" | ||
echo PDO VERSION is $(bin/get_version) | ||
echo "BRANCH is $GITHUB_HEAD_REF" | ||
|
||
- name: Build and run tests | ||
if: "!contains(github.event.commits[0].message, '[debug]')" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The old way of triggering debug builds clearly was hacky. But maybe would be good to add a comment to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. I will document it better. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Small amount of documentation added. |
||
env: | ||
PDO_INTERPRETER: ${{ matrix.interpreter }} | ||
PDO_LOG_LEVEL: warning | ||
|
@@ -41,17 +47,3 @@ jobs: | |
git checkout -b ci-test-branch | ||
. build/common-config.sh | ||
make -C docker test | ||
|
||
- name: Build and run tests (DEBUG MODE) | ||
if: "contains(github.event.commits[0].message, '[debug]')" | ||
env: | ||
PDO_INTERPRETER: ${{ matrix.interpreter }} | ||
PDO_LOG_LEVEL: debug | ||
run: | | ||
# The creation of a dummy branch is necessary for the CI tests | ||
# to work on PRs. Based on empirical results, in the absence of | ||
# this command, CI tests work on the main branch and on local | ||
# branches. However, they fail as a PR is created. | ||
git checkout -b ci-test-branch | ||
. build/common-config.sh | ||
make -C docker test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be another parameter (input)? Although admittedly as everything is done in docker, if we would parameterize that it probably would be better to parameterize docker's
UBUNTU_VERSION
build argument?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point. if i can actually use the variables from the dispatch i will add this. it will probably have to be fixed in a later PR though since i have no way to test it right now.