ci: use virtual environment in functional tests #1094
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: build atSDK | |
run: | | |
cmake -S . -B build -DATSDK_BUILD_TESTS="unit" | |
cmake --build build --target all | |
- name: atchops Unit CTest | |
working-directory: build/packages/atchops/tests | |
run: ctest --test-dir . --output-on-failure --timeout 5 | |
- name: atclient Unit CTest | |
working-directory: build/packages/atclient/tests | |
run: ctest --test-dir . --output-on-failure --timeout 5 | |
functional-tests: | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Load secrets | |
working-directory: tests/functional_tests/tools/virtualenv/keys | |
run: | | |
mkdir -p ~/.atsign/keys/ | |
cp "@alice🛠_key.atKeys" ~/.atsign/keys/ | |
cp "@bob🛠_key.atKeys" ~/.atsign/keys/ | |
- name: Install Docker Compose | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y docker-compose | |
- 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 and PKAM Virtual Environment | |
working-directory: tests/functional_tests/tools/virtualenv | |
run: | | |
./start_virtualenv.sh | |
sleep 2 | |
./pkam_virtualenv.sh | |
sleep 15 | |
- name: Install atSDK | |
run: | | |
cmake -S . -B build -DATSDK_BUILD_TESTS="func" -DCMAKE_BUILD_TYPE=Debug -DFIRST_ATSIGN="\"@alice🛠\"" -DSECOND_ATSIGN="\"@bob🛠\"" -DATDIRECTORY_HOST='"vip.ve.atsign.zone"' -DATDIRECTORY_PORT=64 | |
sudo cmake --build build --target install | |
- name: Build and Run Functional Tests | |
run: | | |
ctest --test-dir build/tests/functional_tests -VV --timeout 30 | |
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 |