Skip to content

chore(deps): bump actions/attest-build-provenance from 2.2.1 to 2.2.2 in the github-actions group #1380

chore(deps): bump actions/attest-build-provenance from 2.2.1 to 2.2.2 in the github-actions group

chore(deps): bump actions/attest-build-provenance from 2.2.1 to 2.2.2 in the github-actions group #1380

Workflow file for this run

name: Unit and Functional Tests
on:
workflow_dispatch:
push:
branches: [trunk]
pull_request:
branches: [trunk]
permissions: # added using https://github.com/step-security/secure-repo
contents: read
jobs:
unit-tests:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install valgrind
run: |
sudo apt-get update
sudo apt-get install automake autoconf libtool libsubunit-dev valgrind
- name: Build atSDK
run: |
cmake -S . -B build \
-DATSDK_BUILD_TESTS="unit" \
-DCMAKE_BUILD_TYPE="Debug" \
-DCMAKE_C_FLAGS="-std=c99 -Wall -Wextra -Werror-implicit-function-declaration" \
-DATSDK_MEMCHECK=ON
cmake --build build --target all
- name: Run tests
run: ctest --test-dir build --output-on-failure --timeout 5 -VV
# Unit tests are so fast we can run them serially and they will still
# finish before the functional tests.
# Long timeout because RSA keygen test sometimes takes a while
- name: Run memcheck tests
run: ctest -T memcheck --test-dir build --output-on-failure --timeout 60 -VV
functional-tests:
strategy:
fail-fast: true
matrix:
include:
- type: normal
flags: ""
valgrind: false
- type: memcheck
flags: "-T memcheck"
valgrind: true
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Load secrets
working-directory: tests/functional_tests/virtualenv/keys
run: |
mkdir -p ~/.atsign/keys/
cp "@alice🛠_key.atKeys" ~/.atsign/keys/
cp "@bob🛠_key.atKeys" ~/.atsign/keys/
- name: Add vip.ve.atsign.zone to /etc/hosts
run: |
echo "127.0.0.1 vip.ve.atsign.zone" | sudo tee -a /etc/hosts
- name: Start Virtual Environment
working-directory: tests/functional_tests/virtualenv
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
./start_virtualenv.sh
sleep 1
./pkam_virtualenv.sh
- name: Build and Run Check Docker Readiness
working-directory: tests/functional_tests/check_docker_readiness
run: |
cmake -S . -B build
cmake --build build
for i in {1..3}; do ./build/check_docker_readiness && break || sleep 5; done
- name: Install valgrind
if: ${{ matrix.valgrind == true }}
run: |
sudo apt-get update
sudo apt-get install automake autoconf libtool libsubunit-dev valgrind
- name: Install atSDK
run: |
cmake -S . -B build \
-DATSDK_BUILD_TESTS="func" \
-DCMAKE_BUILD_TYPE=Debug \
-DATSDK_MEMCHECK=ON \
-DCMAKE_C_FLAGS="-std=c99 -Wall -Wextra -Werror-implicit-function-declaration" \
-DATDIRECTORY_HOST="\"vip.ve.atsign.zone\"" \
-DATDIRECTORY_PORT=64 \
-DFIRST_ATSIGN="\"@alice🛠\"" \
-DSECOND_ATSIGN="\"@bob🛠\"" \
-DFIRST_ATSIGN_ATSERVER_HOST="\"vip.ve.atsign.zone\"" \
-DFIRST_ATSIGN_ATSERVER_PORT=25000 \
-DSECOND_ATSIGN_ATSERVER_HOST="\"vip.ve.atsign.zone\"" \
-DSECOND_ATSIGN_ATSERVER_PORT=25003
cmake --build build
- name: Run ${{ matrix.type }} Functional Tests
run: |
ctest ${{ matrix.flags }} --test-dir build --output-on-failure --timeout 90 -VV
build-examples:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install atSDK
run: |
cmake -S . -B build
sudo cmake --build build --target install
- name: Build at_talk
working-directory: examples/desktop/at_talk
run: |
cmake -S . -B build
cmake --build build
- name: Build all CRUD examples
working-directory: examples/desktop/crud
run: |
cmake -S . -B build -DTARGET_SRC=delete.c && cmake --build build
cmake -S . -B build -DTARGET_SRC=get_publickey.c && cmake --build build
cmake -S . -B build -DTARGET_SRC=get_selfkey.c && cmake --build build
cmake -S . -B build -DTARGET_SRC=get_sharedkey.c && cmake --build build
cmake -S . -B build -DTARGET_SRC=put_publickey.c && cmake --build build
cmake -S . -B build -DTARGET_SRC=put_selfkey.c && cmake --build build
cmake -S . -B build -DTARGET_SRC=put_sharedkey.c && cmake --build build
- name: Build events
working-directory: examples/desktop/events
run: |
cmake -S . -B build
cmake --build build
- name: Build pkam_authenticate
working-directory: examples/desktop/pkam_authenticate
run: |
cmake -S . -B build
cmake --build build
- name: Build REPL
working-directory: examples/desktop/repl
run: |
cmake -S . -B build
cmake --build build
- name: Build reconnection example
working-directory: examples/desktop/reconnection
run: |
cmake -S . -B build
cmake --build build --target install
- name: Build sample cmake project
working-directory: examples/desktop/sample_cmake_project
run: |
cmake -S . -B build -Datsdk="/usr/local/bin/cmake/atsdk"
cmake --build build