Skip to content

Commit d61f85f

Browse files
committed
Enable automated testing for github pull requests
Add github workflow to run tests on the default suite of contract families (currently all families). Rather than build the necessary PDO docker images, they are pulled from the github container registry. The tests will fail unless the appropriate images are available. Signed-off-by: Mic Bowman <cmickeyb@gmail.com> Signed-off-by: Mic Bowman <mic.bowman@intel.com>
1 parent fea8121 commit d61f85f

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

.github/workflows/full_test.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
# pull request. That is, this is a minimal functionality that must
77
# be successfully executed prior to merging a pull request. Note
88
# that this can be overridden by adding '[skip ci]' in the commit
9-
# name. This should not be done on the main PDO branch.
9+
# name.
1010

1111
name: Run full PDO contract tests
12-
on: [ pull_request ]
12+
on: [ workflow_dispatch, pull_request ]
1313

1414
jobs:
1515
pdo_ci:
@@ -20,10 +20,9 @@ jobs:
2020
env:
2121
REGISTRY: ghcr.io
2222
OWNER: ${{ github.repository_owner }}
23-
PDO_USER_NAME: pdo_user
2423
PDO_USER_UID: 55172
2524
PDO_GROUP_UID: 55172
26-
25+
PDO_SOURCE_ROOT: private-data-objects
2726
steps:
2827
- name: Check out repo
2928
uses: actions/checkout@v4
@@ -34,8 +33,8 @@ jobs:
3433

3534
- name: Set the version
3635
run: |
37-
echo "PDO_VERSION=$(private-data-objects/bin/get_version -f private-data-objects/VERSION)" >> $GITHUB_ENV
38-
echo "PDO_CONTRACTS_VERSION=$(private-data-objects/bin/get_version -f VERSION)" >> $GITHUB_ENV
36+
echo "PDO_VERSION=$(${PDO_SOURCE_ROOT}/bin/get_version -f ${PDO_SOURCE_ROOT}/VERSION)" >> $GITHUB_ENV
37+
echo "PDO_CONTRACTS_VERSION=$(bin/get_version)" >> $GITHUB_ENV
3938
4039
- name: Show the version
4140
run: |
@@ -44,7 +43,7 @@ jobs:
4443
4544
- name: Configure PDO and build the base images
4645
run: |
47-
if $(./require_pdo_images.sh -r ${REGISTRY}/${OWNER} -v ${PDO_VERSION})
46+
if $(docker/require_pdo_images.sh -r ${REGISTRY}/${OWNER} -v ${PDO_VERSION})
4847
then
4948
echo Using pre-built PDO images
5049
else
@@ -56,8 +55,8 @@ jobs:
5655
- name: Build and run contract tests
5756
run: |
5857
git checkout -b ci-test-branch
59-
chown -R $PDO_USER_NAME:$PDO_USER_NAME docker/xfer
60-
chmod -R g+w docker/xfer
58+
sudo chown -R $PDO_USER_UID:$PDO_GROUP_UID docker/xfer
59+
sudo chmod -R g+w docker/xfer
6160
make -C docker test \
6261
CONTRACTS_USER_UID=$PDO_USER_UID CONTRACTS_GROUP_UID=$PDO_GROUP_UID \
63-
PDO_VERSION=$PDO_VERSION PDO_REGISTRY=$REGISTRY/${PDO_OWNER}
62+
PDO_VERSION=$PDO_VERSION PDO_REGISTRY=$REGISTRY/$OWNER

docker/require_pdo_images.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616

1717
SCRIPT_NAME=$(basename ${BASH_SOURCE[-1]} )
18-
source ${PDO_HOME}/bin/lib/common.sh
18+
source ${PDO_SOURCE_ROOT}/bin/lib/common.sh
1919

2020
# -----------------------------------------------------------------
2121
# Process command line arguments

0 commit comments

Comments
 (0)