Skip to content

Commit b009f28

Browse files
author
Bridger Voss
committed
test github actions for python3-ntp
1 parent ff8bba6 commit b009f28

File tree

1 file changed

+101
-0
lines changed

1 file changed

+101
-0
lines changed

.github/workflows/python3-ntp.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: python3-ntp Tests
2+
3+
# START OF COMMON SECTION
4+
on:
5+
push:
6+
branches: [ '*' ] #'master', 'main', 'release/**' ]
7+
pull_request:
8+
branches: [ '*' ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
# END OF COMMON SECTION
14+
15+
jobs:
16+
build_wolfprovider:
17+
uses: ./.github/workflows/build-wolfprovider.yml
18+
with:
19+
wolfssl_ref: ${{ matrix.wolfssl_ref }}
20+
openssl_ref: ${{ matrix.openssl_ref }}
21+
strategy:
22+
matrix:
23+
wolfssl_ref: [ 'master', 'v5.8.0-stable' ]
24+
openssl_ref: [ 'openssl-3.5.0' ]
25+
26+
test_python3-ntp:
27+
runs-on: ubuntu-22.04
28+
needs: build_wolfprovider
29+
# This should be a safe limit for the tests to run.
30+
timeout-minutes: 20
31+
strategy:
32+
matrix:
33+
python3-ntp_ref: [ 'master', 'NTPsec_1_2_2' ]
34+
wolfssl_ref: [ 'master', 'v5.8.0-stable' ]
35+
openssl_ref: [ 'openssl-3.5.0' ]
36+
force_fail: [ 'WOLFPROV_FORCE_FAIL=1', '' ]
37+
exclude:
38+
- python3-ntp_ref: 'master'
39+
force_fail: 'WOLFPROV_FORCE_FAIL=1'
40+
steps:
41+
- name: Checkout wolfProvider
42+
uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 1
45+
46+
- name: Retrieving wolfProvider from cache
47+
uses: actions/cache/restore@v4
48+
id: wolfprov-cache-restore
49+
with:
50+
path: |
51+
wolfssl-install
52+
wolfprov-install
53+
openssl-install/lib64
54+
openssl-install/include
55+
openssl-install/bin
56+
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }}
57+
fail-on-cache-miss: true
58+
59+
- name: Install python3-ntp dependencies
60+
run: |
61+
sudo apt-get update
62+
sudo apt-get install -y build-essential bison libcap-dev libseccomp-dev libavahi-compat-libdnssd-dev pps-tools python-dev-is-python3
63+
64+
- name: Checkout python3-ntp
65+
uses: actions/checkout@v4
66+
with:
67+
repository: ntpsec/ntpsec
68+
ref: ${{ matrix.python3-ntp_ref }}
69+
path: ntpsec
70+
fetch-depth: 1
71+
72+
- name: Checkout OSP
73+
uses: actions/checkout@v4
74+
with:
75+
repository: wolfSSL/osp
76+
path: osp
77+
fetch-depth: 1
78+
- run: |
79+
cd ntpsec
80+
patch -p1 < $GITHUB_WORKSPACE/osp/wolfProvider/python3-ntp/python3-ntp-${{ matrix.python3-ntp_ref }}-wolfprov.patch
81+
82+
- name: Build ntpsec
83+
working-directory: ntpsec
84+
run: |
85+
./waf configure
86+
./waf build
87+
88+
- name: Run python3-ntp tests
89+
working-directory: ntpsec
90+
run: |
91+
# Set up the environment for wolfProvider
92+
source $GITHUB_WORKSPACE/scripts/env-setup
93+
export ${{ matrix.force_fail }}
94+
# Run tests
95+
./waf check | tee python3-ntp-test.log
96+
if grep -q "'check' finished successfully" python3-ntp-test.log; then
97+
TEST_RESULT=0
98+
else
99+
TEST_RESULT=1
100+
fi
101+
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} python3-ntp

0 commit comments

Comments
 (0)