Skip to content

Commit

Permalink
Add an example CI workflow (#1)
Browse files Browse the repository at this point in the history
This adds a CI workflow for the example plugin that builds and tests
against the current development version and the last release of Tenzir.
  • Loading branch information
dominiklohmann authored Apr 11, 2024
1 parent ba121c4 commit f240833
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Tests
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
merge_group:
types:
- checks_requested

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}

jobs:
tests:
name: Tests (${{ matrix.version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- main
- latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: |
docker compose build --build-arg TENZIR_VERSION=${{ matrix.version }}
- name: Test
run: |
docker compose run tests
git diff --exit-code
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM tenzir/tenzir-dev:main AS example-builder-untested
ARG TENZIR_VERSION=main
FROM ghcr.io/tenzir/tenzir-dev:${TENZIR_VERSION} AS example-builder-untested

COPY example /plugins/example

Expand All @@ -9,6 +10,7 @@ RUN cmake --install build-example --strip --component Runtime --prefix /plugin/e
FROM example-builder-untested AS example-test

ENV BATS_LIB_PATH=/tmp/tenzir/tenzir/integration/lib
# TODO: Use the update-integration target instead
ENV UPDATE=1

ENTRYPOINT cmake --build build-example --target integration
Expand All @@ -18,6 +20,6 @@ FROM example-builder-untested AS example-builder
ENV BATS_LIB_PATH=/tmp/tenzir/tenzir/integration/lib
RUN cmake --build build-example --target integration

FROM tenzir/tenzir:main
FROM ghcr.io/tenzir/tenzir:${TENZIR_VERSION}

COPY --from=example-builder --chown=tenzir:tenzir /plugin/example /opt/tenzir
6 changes: 6 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ services:
tenzir-node:
build:
context: .
args:
- TENZIR_VERSION=main
environment:
- TENZIR_ALLOW_UNSAFE_PIPELINES=true
- TENZIR_ENDPOINT=tenzir-node:5158
Expand All @@ -24,6 +26,8 @@ services:
tenzir:
build:
context: .
args:
- TENZIR_VERSION=main
profiles:
- donotstart
depends_on:
Expand All @@ -38,6 +42,8 @@ services:
build:
context: .
target: example-test
args:
- TENZIR_VERSION=main
profiles:
- donotstart
volumes:
Expand Down

0 comments on commit f240833

Please sign in to comment.