From 86c9195021ec51af480f90b14f1bed1132db2ce0 Mon Sep 17 00:00:00 2001 From: Arnaldo Cesco Date: Wed, 14 Jun 2023 17:58:40 +0200 Subject: [PATCH] CI: Add database to test workflow The plugin now requires a connection to Astarte's database. Include it in the testing workflow. Signed-off-by: Arnaldo Cesco --- .github/workflows/build-workflow.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build-workflow.yaml b/.github/workflows/build-workflow.yaml index 4c02d06..d4ddecb 100644 --- a/.github/workflows/build-workflow.yaml +++ b/.github/workflows/build-workflow.yaml @@ -60,15 +60,23 @@ jobs: matrix: rabbitmq: - "rabbitmq:3.12.0-management" + database: + - "cassandra:3.11.15" + - "scylladb/scylla:5.2.2" services: rabbitmq: image: ${{ matrix.rabbitmq }} ports: - 5672:5672 - 15672:15672 + database: + image: ${{ matrix.database }} + ports: + - 9042:9042 env: MIX_ENV: test RABBITMQ_HOST: localhost + CASSANDRA_NODES: localhost steps: - uses: actions/checkout@v2 - uses: actions/cache@v1 @@ -93,6 +101,10 @@ jobs: run: mix format --check-formatted - name: Compile run: mix do compile + - name: Wait for Cassandra + run: | + npm install -g wait-for-cassandra + wait-for-cassandra -T 120000 -h $CASSANDRA_NODES - name: Test and Coverage run: mix coveralls.json --exclude wip -o coverage_results - name: Upload Coverage Results to CodeCov