From 208ddf2eeb03d510757aa6528506a980fff4932b Mon Sep 17 00:00:00 2001 From: Jon Lamb Date: Tue, 13 Feb 2024 08:08:23 -0800 Subject: [PATCH] WIP --- .github/workflows/integration_tests.yml | 75 +++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/integration_tests.yml diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml new file mode 100644 index 0000000..3f1ddf9 --- /dev/null +++ b/.github/workflows/integration_tests.yml @@ -0,0 +1,75 @@ +name: Integration Tests +#on: [workflow_dispatch] +on: [push] + +env: + MODALITY_URL: "http://localhost:14181/v1" + MODALITY_WORKSPACE: "ci-tests" + +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 + + - 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 admin + modality user create --use ci + modality user mint-auth-token --name ci-token --allow-http-api --allow-ingest --allow-mutation /tmp/auth-token + echo "MODALITY_AUTH_TOKEN=$(cat /tmp/auth-token)" >> $GITHUB_ENV + modality workspace create --use ${{env.MODALITY_WORKSPACE}} config/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/