From 0f781e6483862982f3a7e115bc333f5f4a656e72 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Fri, 15 Dec 2023 18:00:01 -0500 Subject: [PATCH] Add sdk test job that runs against an active server --- .github/workflows/sdk.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/sdk.yml diff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.yml new file mode 100644 index 0000000000..98a9a32dd7 --- /dev/null +++ b/.github/workflows/sdk.yml @@ -0,0 +1,37 @@ +name: SDK +on: [push, pull_request] + +defaults: + run: + shell: bash + +jobs: + sdk-with-server: + runs-on: ubuntu-latest + container: debian:bullseye + env: + DOCKERIZE_VERSION: "v0.7.0" + steps: + - name: Install dependencies + run: | + apt-get update && apt-get install --yes git make python3-pip docker.io wget + pip install poetry==1.6.1 + wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && + tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && + rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + repository: "freedomofpress/securedrop" + path: "securedrop-server" + - name: Run tests without VCR cassettes + run: | + # Start the server in the background + NUM_SOURCES=5 make -C securedrop-server dev & + # Wait for it to be up + dockerize -wait http://127.0.0.1:8080 -timeout 10m + # Install deps and run tests + cd client + poetry install --no-ansi + rm tests/sdk/data/*.yml + make test