Skip to content

Commit 832f89f

Browse files
authored
Updates to github workflows for PDO (#504)
* Updates to github workflows for PDO *EXPERIMENTAL* -- new github workflows will only be visible and runnable when they are attached to the main branch. this commit will enable further testing. Expand the github workflows associated with the PDO repository. The old "ci" workflow has been moved to a workflow called "full_test" and is used as a condition for merge of PRs. It will no longer be run on every push but only on PR creation. Add a "configured_test" workflow that can be dispatched on demand. This workflow allows for different build and run parameters to be set interactively. Add a "build_docker" workflow that will attempt to build docker images pdo_client, pdo_services and pdo_ccf when a PR is merged successfully. This workflow can also be dispatched interactively. Signed-off-by: Mic Bowman <[email protected]> * add documentation to workflows Signed-off-by: Mic Bowman <[email protected]> --------- Signed-off-by: Mic Bowman <[email protected]>
1 parent ed36943 commit 832f89f

File tree

3 files changed

+146
-20
lines changed

3 files changed

+146
-20
lines changed

Diff for: .github/workflows/configured_test.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
5+
# This workflow is intended to provide an interactive way of configuring
6+
# PDO tests. Common configuration variables can be set interactively to
7+
# debug differences between local and github.
8+
9+
name: Run specific PDO tests
10+
on:
11+
workflow_dispatch:
12+
inputs:
13+
interpreter:
14+
description: 'Interpreter'
15+
required: true
16+
default: 'wawaka'
17+
type: choice
18+
options:
19+
- wawaka
20+
- wawaka-opt
21+
logLevel:
22+
description: 'Log level'
23+
required: true
24+
default: 'warning'
25+
type: choice
26+
options:
27+
- debug
28+
- info
29+
- warning
30+
memoryConfiguration:
31+
description: 'Interpreter memory configuration'
32+
required: false
33+
default: MEDIUM
34+
type: choice
35+
options:
36+
- SMALL
37+
- MEDIUM
38+
- LARGE
39+
40+
jobs:
41+
pdo_specific_tests:
42+
name: Run specific PDO tests
43+
runs-on: ubuntu-22.04
44+
45+
steps:
46+
- name: Check out repo
47+
uses: actions/checkout@v4
48+
with:
49+
submodules: recursive
50+
fetch-depth: 0
51+
fetch-tags: true
52+
53+
- name: Display branch name
54+
run: |
55+
echo "Building branch $GITHUB_HEAD_REF"
56+
echo PDO VERSION is $(bin/get_version)
57+
58+
- name: Build and run tests
59+
env:
60+
PDO_INTERPRETER: ${{ inputs.interpreter }}
61+
PDO_LOG_LEVEL: ${{ inputs.logLevel }}
62+
PDO_MEMORY_CONFIG: ${{ inputs.memoryConfiguration }}
63+
PDO_DEBUG_BUILD: 1
64+
run: |
65+
# The creation of a dummy branch is necessary for the CI tests
66+
# to work on PRs. Based on empirical results, in the absence of
67+
# this command, CI tests work on the main branch and on local
68+
# branches. However, they fail as a PR is created.
69+
git checkout -b ci-test-branch
70+
. build/common-config.sh
71+
make -C docker test

Diff for: .github/workflows/docker.yml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
5+
name: Build and Push PDO Docker Images
6+
7+
on:
8+
workflow_dispatch:
9+
10+
pull_request:
11+
types: [closed]
12+
branches: [main]
13+
14+
jobs:
15+
16+
docker_build:
17+
18+
if: >
19+
github.event.name == 'workflow_dispatch' ||
20+
github.event.name == 'pull_request' && github.event.pull_request.merged == true
21+
name: Build PDO Images
22+
runs-on: ubuntu-22.04
23+
24+
steps:
25+
- name: Check out repo
26+
uses: actions/checkout@v4
27+
with:
28+
submodules: recursive
29+
fetch-depth: 0
30+
fetch-tags: true
31+
32+
- name: Display branch name
33+
run: |
34+
echo "Building branch images for $GITHUB_HEAD_REF"
35+
echo PDO VERSION is $(bin/get_version)
36+
echo "PDO_VERSION=$(bin/get_version)" >> $GITHUB_ENV
37+
echo "EVENT NAME: ${{ github.event.name }}"
38+
echo "MERGED: ${{ github.event.pull_request.merged }}"
39+
40+
- name: Build Docker Images
41+
env:
42+
PDO_INTERPRETER: wawaka
43+
PDO_LOG_LEVEL: warning
44+
run: |
45+
git checkout -b ci-test-branch
46+
. build/common-config.sh
47+
make -C docker
48+
49+
- name: Login to the ghcr.io Container Registry
50+
uses: docker/login-action@v2
51+
with:
52+
registry: ghcr.io
53+
username: ${{ github.actor }}
54+
password: ${{ secrets.GITHUB_TOKEN }}
55+
56+
- name: Tag and push the images
57+
run: |
58+
for image in pdo_services pdo_ccf pdo_client
59+
do
60+
docker image tag ghcr.io/{{ github.repository_owner }}/$image:$PDO_VERSION
61+
docker image tag ghcr.io/{{ github.repository_owner }}/$image:latest
62+
docker image push --all-tags ghcr.io/{{ github.repository_owner }}/$image
63+
done

Diff for: .github/workflows/ci.yaml renamed to .github/workflows/full_test.yml

+12-20
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

5-
name: PDO CI
6-
on: [pull_request, push]
5+
# This workflow is intended to be used as a validity test for any
6+
# pull request. That is, this is a minimal functionality that must
7+
# be successfully executed prior to merging a pull request. Note
8+
# that this can be overridden by adding '[skip ci]' in the commit
9+
# name. This should not be done on the main PDO branch.
10+
11+
name: Run full PDO tests
12+
on: [ pull_request ]
13+
714
jobs:
8-
pdo_ci:
15+
pdo_full_tests:
916
if: "!contains(github.event.commits[0].message, '[skip ci]')"
10-
name: PDO CI Job
17+
name: Run full PDO tests
1118
runs-on: ubuntu-22.04
1219

1320
strategy:
@@ -25,11 +32,10 @@ jobs:
2532

2633
- name: Display branch name
2734
run: |
28-
echo "Building branch $GITHUB_HEAD_REF"
2935
echo PDO VERSION is $(bin/get_version)
36+
echo "BRANCH is $GITHUB_HEAD_REF"
3037
3138
- name: Build and run tests
32-
if: "!contains(github.event.commits[0].message, '[debug]')"
3339
env:
3440
PDO_INTERPRETER: ${{ matrix.interpreter }}
3541
PDO_LOG_LEVEL: warning
@@ -41,17 +47,3 @@ jobs:
4147
git checkout -b ci-test-branch
4248
. build/common-config.sh
4349
make -C docker test
44-
45-
- name: Build and run tests (DEBUG MODE)
46-
if: "contains(github.event.commits[0].message, '[debug]')"
47-
env:
48-
PDO_INTERPRETER: ${{ matrix.interpreter }}
49-
PDO_LOG_LEVEL: debug
50-
run: |
51-
# The creation of a dummy branch is necessary for the CI tests
52-
# to work on PRs. Based on empirical results, in the absence of
53-
# this command, CI tests work on the main branch and on local
54-
# branches. However, they fail as a PR is created.
55-
git checkout -b ci-test-branch
56-
. build/common-config.sh
57-
make -C docker test

0 commit comments

Comments
 (0)