-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf34b05
commit 1f8dd48
Showing
51 changed files
with
4,126 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
name: Integration Tests | ||
#on: [workflow_dispatch] | ||
on: [push] | ||
|
||
env: | ||
MODALITY_URL: "http://localhost:14181/v1" | ||
MODALITY_WORKSPACE: "ci-tests" | ||
RENODE_CI_MODE: YES | ||
|
||
jobs: | ||
demo: | ||
name: Run, collect, and test | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Print Environment | ||
run: | | ||
echo "GITHUB_WORKFLOW=$GITHUB_WORKFLOW" | ||
echo "GITHUB_RUN_ID=$GITHUB_RUN_ID" | ||
echo "GITHUB_RUN_NUMBER=$GITHUB_RUN_NUMBER" | ||
echo "GITHUB_JOB=$GITHUB_JOB" | ||
echo "GITHUB_ACTION=$GITHUB_ACTION" | ||
echo "GITHUB_ACTOR=$GITHUB_ACTOR" | ||
echo "GITHUB_REF=$GITHUB_REF" | ||
echo "GITHUB_SHA=$GITHUB_SHA" | ||
docker --version | ||
- name: Checkout Sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install system packages | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libusb-1.0-0-dev libftdi1-dev libudev-dev bridge-utils gcc-arm-none-eabi binutils-arm-none-eabi | ||
- name: Install renode (latest) | ||
run: | | ||
cd /opt | ||
sudo wget --quiet --output-document renode.tar.gz https://builds.renode.io/renode-latest.linux-portable.tar.gz | ||
sudo mkdir renode | ||
sudo tar xf renode.tar.gz -C renode --strip-components 1 | ||
sudo pip install -r /opt/renode/tests/requirements.txt | ||
echo "PATH=/opt/renode:${PATH}" >> $GITHUB_ENV | ||
- name: Install toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: clippy, rustfmt | ||
toolchain: stable | ||
|
||
- name: Build release binary | ||
run: cargo build --release | ||
|
||
- name: Install Auxon packages | ||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
run: | | ||
wget --no-verbose --quiet https://get.keygen.sh/auxon-io/auxon.deb -O /tmp/auxon.deb | ||
sudo apt-get install -y /tmp/auxon.deb | ||
sudo apt-get update | ||
sudo apt-get install -y --no-install-recommends modalityd modality-client modality-reflector conform deviant | ||
- name: Setup Modality server | ||
run: | | ||
sudo systemctl stop modalityd | ||
echo 'license-key = "'"${{secrets.MODALITY_LICENSE_KEY}}"'"' | sudo tee -a /etc/modalityd/config.toml | ||
sudo systemctl start modalityd | ||
sudo systemctl status modalityd --no-pager --full | ||
curl --retry-max-time 30 --retry 10 --retry-connrefused ${{env.MODALITY_URL}}/alive | ||
- name: Setup initial Modality configuration | ||
run: | | ||
modality --version | ||
modality config --modalityd ${{env.MODALITY_URL}} | ||
modality user create --use ci | ||
echo "MODALITY_AUTH_TOKEN=$(modality user auth-token)" >> $GITHUB_ENV | ||
modality workspace create --use ${{env.MODALITY_WORKSPACE}} test_system/workspace.toml | ||
- name: Update reflector plugins | ||
run: | | ||
sudo cp target/release/modality-trace-recorder-importer /usr/lib/modality-reflector-plugins/importers/ | ||
sudo cp target/release/modality-trace-recorder-tcp-collector /usr/lib/modality-reflector-plugins/collectors/ | ||
sudo cp target/release/modality-trace-recorder-itm-collector /usr/lib/modality-reflector-plugins/collectors/ | ||
- name: Create specs | ||
run: | | ||
conform spec create --file test_system/specs/device.speqtr device-specs | ||
- name: Setup test network | ||
working-directory: test_system | ||
run: sudo ./scripts/setup-network.sh & | ||
|
||
- name: Build test system | ||
working-directory: test_system | ||
run: ./scripts/build.sh | ||
|
||
- name: Run the system | ||
working-directory: test_system | ||
env: | ||
MODALITY_AUTH_TOKEN: ${{env.MODALITY_AUTH_TOKEN}} | ||
run: ./scripts/run.sh | ||
|
||
- name: Inspect data | ||
env: | ||
MODALITY_AUTH_TOKEN: ${{env.MODALITY_AUTH_TOKEN}} | ||
run: | | ||
modality workspace list | ||
modality workspace inspect ${{env.MODALITY_WORKSPACE}} | ||
modality segment list | ||
- name: Evaluate specs | ||
continue-on-error: true | ||
env: | ||
MODALITY_AUTH_TOKEN: ${{env.MODALITY_AUTH_TOKEN}} | ||
run: | | ||
conform spec eval --name device-specs | ||
- name: Export Data | ||
env: | ||
MODALITY_AUTH_TOKEN: ${{env.MODALITY_AUTH_TOKEN}} | ||
run: | | ||
datetime=$(date +'%Y-%m-%dT%H-%M-%SZ') | ||
tarfile=modality_demo_system_data_${datetime}.tar.gz | ||
echo TARBALL_NAME=${tarfile} >> $GITHUB_ENV | ||
sudo systemctl stop modalityd | ||
modality user auth-token | sudo tee /var/lib/modality/user_auth_token | ||
cd /tmp && sudo tar czvf ${tarfile} -C /var/lib modality | ||
- name: Upload Modality data | ||
uses: actions/upload-artifact@v3 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
name: ${{ env.TARBALL_NAME }} | ||
path: /tmp/${{ env.TARBALL_NAME }} | ||
retention-days: 2 | ||
if-no-files-found: error |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build | ||
.gdb_history | ||
tags |
Oops, something went wrong.