Skip to content

Commit b9bcb2a

Browse files
committed
update workflow files from latest master
1 parent 8909971 commit b9bcb2a

File tree

5 files changed

+297
-29
lines changed

5 files changed

+297
-29
lines changed

.github/workflows/cppcheck.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Cppcheck Test
2+
3+
on:
4+
push:
5+
branches: [ '*' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
jobs:
10+
run_cppcheck:
11+
name: Cppcheck
12+
runs-on: ubuntu-24.04
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Install cppcheck
17+
if: always()
18+
run: sudo apt-get install cppcheck
19+
20+
- name: Run CppCheck
21+
id: cpp_check_run
22+
if: always()
23+
run: >
24+
cppcheck
25+
-UWSCPFILEHDR -UXSNPRINTF
26+
-DLIBWOLFSSH_VERSION_STRING='""'
27+
--enable='warning,portability'
28+
--std=c99
29+
--force
30+
--check-level=exhaustive
31+
--error-exitcode=2
32+
--library=std.cfg
33+
--inline-suppr
34+
-j4
35+
-q
36+
.
37+
3>&1 1>&2 2>&3 | tee cppcheck.txt
38+
39+
- name: Upload cppcheck results as artifact
40+
if: always()
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: wolfssh-${{ github.sha }}-cppcheck_results.txt
44+
path: cppcheck.txt

.github/workflows/os-check.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,28 @@ concurrency:
1010
group: ${{ github.workflow }}-${{ github.ref }}
1111
cancel-in-progress: true
1212

13-
env:
14-
WOLFSSL_REF: v5.7.0-stable
15-
1613
jobs:
14+
create_matrix:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
versions: ${{ steps.json.outputs.versions }}
18+
steps:
19+
- name: Create wolfSSL version matrix
20+
id: json
21+
run: |
22+
current=`curl -s https://api.github.com/repos/wolfssl/wolfssl/releases | grep tag_name | cut -d : -f 2,3 | tr -d \" | tr -d , | tr -d ' ' | head -1`
23+
last=`curl -s https://api.github.com/repos/wolfssl/wolfssl/releases | grep tag_name | cut -d : -f 2,3 | tr -d \" | tr -d , | tr -d ' ' | head -2 | tail -1`
24+
VERSIONS=$(echo "[ \"master\", \"$current\", \"$last\" ]")
25+
echo "wolfSSL versions found: $VERSIONS"
26+
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
27+
1728
build_wolfssl:
29+
needs: create_matrix
1830
strategy:
1931
fail-fast: false
2032
matrix:
2133
os: [ ubuntu-latest, macos-latest ]
34+
wolfssl: ${{ fromJson(needs.create_matrix.outputs['versions']) }}
2235
name: Build wolfssl
2336
runs-on: ${{ matrix.os }}
2437
timeout-minutes: 4
@@ -28,25 +41,32 @@ jobs:
2841
id: cache-wolfssl
2942
with:
3043
path: build-dir/
31-
key: wolfssh-os-check-wolfssl-${{ env.WOLFSSL_REF }}-${{ matrix.os }}
44+
key: wolfssh-os-check-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
3245
lookup-only: true
3346

47+
- name: debug
48+
run: echo wolfssl version ${{ matrix.wolfssl }}
49+
3450
- name: Checkout, build, and install wolfssl
3551
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
3652
uses: wolfSSL/actions-build-autotools-project@v1
3753
with:
3854
repository: wolfssl/wolfssl
39-
ref: ${{ env.WOLFSSL_REF }}
55+
ref: ${{ matrix.wolfssl }}
4056
path: wolfssl
4157
configure: --enable-all
4258
check: false
4359
install: true
4460

4561
build_wolfssh:
62+
needs:
63+
- build_wolfssl
64+
- create_matrix
4665
strategy:
4766
fail-fast: false
4867
matrix:
4968
os: [ ubuntu-latest, macos-latest ]
69+
wolfssl: ${{ fromJson(needs.create_matrix.outputs['versions']) }}
5070
config: [
5171
'',
5272
'--enable-all',
@@ -57,13 +77,12 @@ jobs:
5777
name: Build wolfssh
5878
runs-on: ${{ matrix.os }}
5979
timeout-minutes: 4
60-
needs: build_wolfssl
6180
steps:
6281
- name: Checking cache for wolfssl
6382
uses: actions/cache@v4
6483
with:
6584
path: build-dir/
66-
key: wolfssh-os-check-wolfssl-${{ env.WOLFSSL_REF }}-${{ matrix.os }}
85+
key: wolfssh-os-check-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
6786
fail-on-cache-miss: true
6887

6988
- name: Checkout, build, and test wolfssh

.github/workflows/scp-test.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: wolfSSH SCP Test
2+
3+
on:
4+
push:
5+
branches: [ '*' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
create_matrix:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
versions: ${{ steps.json.outputs.versions }}
18+
steps:
19+
- name: Create wolfSSL version matrix
20+
id: json
21+
run: |
22+
current=`curl -s https://api.github.com/repos/wolfssl/wolfssl/releases | grep tag_name | cut -d : -f 2,3 | tr -d \" | tr -d , | tr -d ' ' | head -1`
23+
last=`curl -s https://api.github.com/repos/wolfssl/wolfssl/releases | grep tag_name | cut -d : -f 2,3 | tr -d \" | tr -d , | tr -d ' ' | head -2 | tail -1`
24+
VERSIONS=$(echo "[ \"master\", \"$current\", \"$last\" ]")
25+
echo "wolfSSL versions found: $VERSIONS"
26+
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
27+
28+
build_wolfssl:
29+
needs: create_matrix
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
os: [ ubuntu-latest ]
34+
wolfssl: ${{ fromJson(needs.create_matrix.outputs['versions']) }}
35+
name: Build wolfssl
36+
runs-on: ${{ matrix.os }}
37+
timeout-minutes: 4
38+
steps:
39+
- name: Checking cache for wolfssl
40+
uses: actions/cache@v4
41+
id: cache-wolfssl
42+
with:
43+
path: build-dir/
44+
key: wolfssh-sshd-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
45+
lookup-only: true
46+
47+
- name: Checkout, build, and install wolfssl
48+
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
49+
uses: wolfSSL/actions-build-autotools-project@v1
50+
with:
51+
repository: wolfssl/wolfssl
52+
ref: ${{ matrix.wolfssl }}
53+
path: wolfssl
54+
configure: --enable-all
55+
check: false
56+
install: true
57+
58+
build_wolfssh:
59+
needs:
60+
- build_wolfssl
61+
- create_matrix
62+
strategy:
63+
fail-fast: false
64+
matrix:
65+
os: [ ubuntu-latest ]
66+
wolfssl: ${{ fromJson(needs.create_matrix.outputs['versions']) }}
67+
name: Build and test wolfsshd
68+
runs-on: ${{ matrix.os }}
69+
timeout-minutes: 10
70+
steps:
71+
- name: Checking cache for wolfssl
72+
uses: actions/cache@v4
73+
with:
74+
path: build-dir/
75+
key: wolfssh-sshd-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
76+
fail-on-cache-miss: true
77+
78+
- uses: actions/checkout@v4
79+
with:
80+
path: wolfssh/
81+
82+
- name: autogen
83+
working-directory: ./wolfssh/
84+
run: ./autogen.sh
85+
86+
- name: configure
87+
working-directory: ./wolfssh/
88+
run : |
89+
./configure --enable-all LDFLAGS="-L${{ github.workspace }}/build-dir/lib" CPPFLAGS="-I${{ github.workspace }}/build-dir/include -DWOLFSSH_NO_FPKI -DWOLFSSH_NO_SFTP_TIMEOUT -DMAX_PATH_SZ=120"
90+
91+
- name: make
92+
working-directory: ./wolfssh/
93+
run: make
94+
95+
- name: Setup test user
96+
run: sudo useradd -p password jak
97+
98+
# This is a regression test for a reported hang with SCP file transfer.
99+
# Verifying the error from a bad directory is propogated back, and
100+
# that the direcotry/file is not created. To account for potential
101+
# hanging of the operation, the timeout is set to 1 minute.
102+
- name: Run SCP example test
103+
timeout-minutes: 1
104+
working-directory: ./wolfssh/
105+
run: |
106+
mkdir /tmp/wolfssh
107+
echo "test file" > /tmp/wolfssh/test.txt
108+
./examples/scpclient/wolfscp -p 22 -u jak -P password -H 127.0.0.1 -L /tmp/wolfssh/test.txt:/tmp/non_existent_folder/ || true
109+
# check that the directory and file do not exist
110+
[ ! -d /tmp/non_existent_folder ]
111+
[ ! -f /tmp/non_existent_folder/test.txt ]

.github/workflows/sshd-test.yml

Lines changed: 114 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,121 @@ on:
66
pull_request:
77
branches: [ '*' ]
88

9-
jobs:
10-
build:
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
1112

13+
jobs:
14+
create_matrix:
1215
runs-on: ubuntu-latest
16+
outputs:
17+
versions: ${{ steps.json.outputs.versions }}
18+
steps:
19+
- name: Create wolfSSL version matrix
20+
id: json
21+
run: |
22+
current=`curl -s https://api.github.com/repos/wolfssl/wolfssl/releases | grep tag_name | cut -d : -f 2,3 | tr -d \" | tr -d , | tr -d ' ' | head -1`
23+
last=`curl -s https://api.github.com/repos/wolfssl/wolfssl/releases | grep tag_name | cut -d : -f 2,3 | tr -d \" | tr -d , | tr -d ' ' | head -2 | tail -1`
24+
VERSIONS=$(echo "[ \"master\", \"$current\", \"$last\" ]")
25+
echo "wolfSSL versions found: $VERSIONS"
26+
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
27+
28+
build_wolfssl:
29+
needs: create_matrix
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
os: [ ubuntu-latest ]
34+
wolfssl: ${{ fromJson(needs.create_matrix.outputs['versions']) }}
35+
name: Build wolfssl
36+
runs-on: ${{ matrix.os }}
37+
timeout-minutes: 4
38+
steps:
39+
- name: Checking cache for wolfssl
40+
uses: actions/cache@v4
41+
id: cache-wolfssl
42+
with:
43+
path: build-dir/
44+
key: wolfssh-sshd-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
45+
lookup-only: true
46+
47+
- name: Checkout, build, and install wolfssl
48+
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
49+
uses: wolfSSL/actions-build-autotools-project@v1
50+
with:
51+
repository: wolfssl/wolfssl
52+
ref: ${{ matrix.wolfssl }}
53+
path: wolfssl
54+
configure: --enable-all
55+
check: false
56+
install: true
1357

58+
build_wolfssh:
59+
needs:
60+
- build_wolfssl
61+
- create_matrix
62+
strategy:
63+
fail-fast: false
64+
matrix:
65+
os: [ ubuntu-latest ]
66+
wolfssl: ${{ fromJson(needs.create_matrix.outputs['versions']) }}
67+
name: Build and test wolfsshd
68+
runs-on: ${{ matrix.os }}
69+
timeout-minutes: 10
1470
steps:
15-
- uses: actions/checkout@v2
16-
with:
17-
repository: wolfSSL/wolfssl.git
18-
ref: master
19-
- name: build wolfSSL
20-
run: ./autogen.sh && ./configure --enable-all --prefix=/usr && make && sudo make install
21-
- uses: actions/checkout@v2
22-
- name: autogen
23-
run: ./autogen.sh
24-
- name: configure
25-
run: ./configure --enable-all CPPFLAGS="-DWOLFSSH_NO_FPKI -DWOLFSSH_NO_SFTP_TIMEOUT -DWOLFSSH_MAX_SFTP_RW=4000000"
26-
- name: make
27-
run: make
28-
- name: make check
29-
run: make check
30-
- name: run wolfSSHd tests
31-
run: sudo ./run_all_sshd_tests.sh root
32-
working-directory: ./apps/wolfsshd/test
71+
- name: Checking cache for wolfssl
72+
uses: actions/cache@v4
73+
with:
74+
path: build-dir/
75+
key: wolfssh-sshd-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
76+
fail-on-cache-miss: true
77+
78+
- uses: actions/checkout@v4
79+
with:
80+
path: wolfssh/
81+
82+
- name: autogen
83+
working-directory: ./wolfssh/
84+
run: ./autogen.sh
85+
86+
- name: configure
87+
working-directory: ./wolfssh/
88+
run : |
89+
./configure --enable-all LDFLAGS="-L${{ github.workspace }}/build-dir/lib" CPPFLAGS="-I${{ github.workspace }}/build-dir/include -DWOLFSSH_NO_FPKI -DWOLFSSH_NO_SFTP_TIMEOUT -DWOLFSSH_MAX_SFTP_RW=4000000 -DMAX_PATH_SZ=120"
90+
91+
- name: make check
92+
working-directory: ./wolfssh/
93+
run: make check
94+
95+
- name: Run wolfSSHd tests
96+
working-directory: ./wolfssh/apps/wolfsshd/test
97+
run: |
98+
git log -3
99+
sudo ./run_all_sshd_tests.sh
100+
101+
# could use optimization with caching
102+
- name: Test memory after close down
103+
working-directory: ./wolfssh/
104+
run: |
105+
sudo apt-get -y update
106+
sudo apt-get -y install valgrind
107+
touch sshd_config.txt
108+
./configure --enable-all LDFLAGS="-L${{ github.workspace }}/build-dir/lib" CPPFLAGS="-I${{ github.workspace }}/build-dir/include -DWOLFSSH_NO_FPKI -DWOLFSSH_NO_SFTP_TIMEOUT -DWOLFSSH_MAX_SFTP_RW=4000000 -DMAX_PATH_SZ=120" --enable-static --disable-shared && make
109+
sudo timeout --preserve-status -s 2 5 valgrind --error-exitcode=1 --leak-check=full ./apps/wolfsshd/wolfsshd -D -f sshd_config -h ./keys/server-key.pem -d -p 22222
110+
111+
- name: configure with debug
112+
working-directory: ./wolfssh/
113+
run : |
114+
./configure --enable-all --enable-debug LDFLAGS="-L${{ github.workspace }}/build-dir/lib" CPPFLAGS="-I${{ github.workspace }}/build-dir/include -DWOLFSSH_NO_FPKI -DWOLFSSH_NO_SFTP_TIMEOUT -DWOLFSSH_MAX_SFTP_RW=4000000 -DMAX_PATH_SZ=120"
115+
116+
- name: make
117+
working-directory: ./wolfssh/
118+
run: make
119+
120+
# ssh_kex_algos.sh requires debug output otherwise it is skipped
121+
- name: Run wolfSSHd tests with debug
122+
working-directory: ./wolfssh/apps/wolfsshd/test
123+
run: |
124+
git log -3
125+
sudo ./run_all_sshd_tests.sh --match ssh_kex_algos.sh
126+

.github/workflows/zephyr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
config:
1515
- zephyr-ref: v3.4.0
1616
zephyr-sdk: 0.16.1
17-
runs-on: ubuntu-latest
17+
runs-on: ubuntu-22.04
1818
# This should be a safe limit for the tests to run.
1919
timeout-minutes: 20
2020
steps:
@@ -87,7 +87,7 @@ jobs:
8787
8888
- name: Upload failure logs
8989
if: ${{ failure() && steps.wolfssh-test.outcome == 'failure' }}
90-
uses: actions/upload-artifact@v3
90+
uses: actions/upload-artifact@v4
9191
with:
9292
name: zephyr-client-test-logs
9393
path: logs.zip

0 commit comments

Comments
 (0)