mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-05 23:50:49 +02:00
94a671bed8
setup-alire@v5 caches the gnat_native+gprbuild toolchain via actions/cache (key alr[1][2.1.0][...]), holding ~1.26 GiB - 3x the 428 MiB toolchain, one copy per ref - against the repo's 10 GiB cache cap. On a miss the toolchain is only a ~17s pull from github.com (alire-project releases), so the cache saved ~20-30s on a ~6.5min Ada job (dominated by gnatprove). Not worth the space; install it fresh each run.
83 lines
2.4 KiB
YAML
83 lines
2.4 KiB
YAML
name: WolfSSL Ada Build Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [ 'release/**' ]
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, ready_for_review]
|
|
branches: [ '*' ]
|
|
|
|
jobs:
|
|
build:
|
|
|
|
if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }}
|
|
runs-on: ubuntu-24.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Install alire
|
|
uses: alire-project/setup-alire@v5
|
|
with:
|
|
# The toolchain is downloaded from GitHub releases, so caching is not
|
|
# beneficial relative to the cache space it uses.
|
|
cache: false
|
|
|
|
- name: Install wolfssl Ada
|
|
working-directory: ./wrapper/Ada
|
|
run: alr install
|
|
|
|
- name: Build default.gpr
|
|
working-directory: ./wrapper/Ada
|
|
run: alr exec -- gprbuild default.gpr -j$(nproc)
|
|
|
|
- name: Run Ada wrapper tests
|
|
working-directory: ./wrapper/Ada/tests
|
|
run: alr run
|
|
|
|
- name: Run Ada examples
|
|
id: examples
|
|
working-directory: ./wrapper/Ada/examples
|
|
run: |
|
|
alr build
|
|
|
|
echo "Running sha256_main example..."
|
|
alr run sha256_main
|
|
|
|
echo "Running aes_verify_main example..."
|
|
alr run aes_verify_main
|
|
|
|
echo "Running rsa_verify_main example..."
|
|
alr run rsa_verify_main
|
|
|
|
echo "Running TLS server/client example..."
|
|
alr run tls_server_main &> server.log &
|
|
SERVER_PID=$!
|
|
sleep 1
|
|
echo "test message" | alr run tls_client_main --args=127.0.0.1
|
|
kill $SERVER_PID || true
|
|
|
|
- name: show errors
|
|
if: ${{ failure() && steps.examples.outcome == 'failure' }}
|
|
run: cat ./wrapper/Ada/examples/server.log
|
|
|
|
- name: Install valgrind
|
|
uses: ./.github/actions/install-apt-deps
|
|
with:
|
|
packages: valgrind
|
|
ghcr-debs-tag: ubuntu-24.04-full
|
|
|
|
- name: Run Ada wrapper tests (valgrind)
|
|
working-directory: ./wrapper/Ada/tests
|
|
run: |
|
|
valgrind --leak-check=full --error-exitcode=1 \
|
|
--suppressions=valgrind.supp ./bin/tests
|
|
|
|
- name: Run gnatprove on wolfssl
|
|
working-directory: ./wrapper/Ada
|
|
run: alr gnatprove --level=4 -P wolfssl.gpr -j 0 --warnings=error --checks-as-errors --proof-warnings -U
|
|
|
|
- name: Run gnatprove on examples
|
|
working-directory: ./wrapper/Ada/examples
|
|
run: alr gnatprove --level=4 -P examples.gpr -j 0 --warnings=error --checks-as-errors --proof-warnings -U
|