diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f9f9795753..738cbf727e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -16,6 +16,7 @@ defaults: env: IMAGE_NAME: zeek-image.tar IMAGE_FILE: /tmp/zeek-image.tar + IMAGE_PATH: /tmp jobs: docker-build: @@ -108,3 +109,51 @@ jobs: name: docker-btest path: docker/btest/.tmp if-no-files-found: ignore + + cluster-testing: + # We need the Zeek Docker image build job to complete first, since we need + # the resulting image for our docker-compose setup. + needs: docker-build + runs-on: ubuntu-latest + steps: + # Grab the sources so we have access to btest. Could also use pip, but it + # seems appealing to be using the in-tree version of btest. btest is in a + # submodule; we check it out selectively to save time. + - uses: actions/checkout@v2 + - name: Check out btest + run: git submodule update --init ./auxil/btest + + - name: Download Docker image artifact + uses: actions/download-artifact@v2 + with: + name: ${{ env.IMAGE_NAME }} + path: ${{ env.IMAGE_PATH }} + + - name: Load Docker image + run: | + docker load --input ${{ env.IMAGE_FILE }} + docker tag zeek:latest zeektest:latest + + # The testsuite ref to use for this version of Zeek is stored in a file in + # the Zeek source tree. + - name: Get testsuite version + run: | + echo "TESTSUITE_COMMIT=$(cat ./testing/external/commit-hash.zeek-testing-cluster)" >> $GITHUB_ENV + + - name: Retrieve cluster testsuite + uses: actions/checkout@v2 + with: + repository: zeek/zeek-testing-cluster + path: testing/external/zeek-testing-cluster + ref: ${{ ENV.TESTSUITE_COMMIT }} + + - name: Run testsuite + run: make -C testing/external/zeek-testing-cluster + + - name: Preserve btest artifacts + uses: actions/upload-artifact@v2 + if: failure() + with: + name: cluster-btest + path: testing/external/zeek-testing-cluster/.tmp + if-no-files-found: ignore diff --git a/testing/external/commit-hash.zeek-testing-cluster b/testing/external/commit-hash.zeek-testing-cluster new file mode 100644 index 0000000000..42d09860d4 --- /dev/null +++ b/testing/external/commit-hash.zeek-testing-cluster @@ -0,0 +1 @@ +cc4e2ad8b24015849043b523f0aef00acf41d602