From ab34c8334200655e2bde15a86a8ad215280a19d5 Mon Sep 17 00:00:00 2001 From: Alie Date: Sat, 17 Feb 2024 12:31:32 +0100 Subject: [PATCH] tests added --- .gitea/workflows/01_test.yaml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/01_test.yaml b/.gitea/workflows/01_test.yaml index e6d034f..91cdd66 100644 --- a/.gitea/workflows/01_test.yaml +++ b/.gitea/workflows/01_test.yaml @@ -4,18 +4,21 @@ on: [push, pull_request] jobs: unit-test: container: - image: rust - volumes: - - /usr/local/cargo:/workspace/fedi-image-bot/bot-mastodon-image-uploader/target:rw - steps: + image: docker:dind + volumes: + - /data/.cache/act:/data/.cache/act + - /var/lib/docker/image:/var/lib/docker/image + - /var/lib/docker/overlay2:/var/lib/docker/overlay2 + steps: + - name: Starting docker daemon + run: docker-init -- dockerd --host=unix:///var/run/docker.sock & - name: Installing necessary packages - run: apt update && apt install nodejs git -y + run: apk add nodejs git curl bash - name: Check out repository code uses: actions/checkout@v3 - - run: pwd && ls - name: Get access token from secret run: echo "${{ secrets.MASTODON_SECRET }}" > mastodon-data.toml - name: Check code run: cargo check - - name: Run tests - run: cargo test -- --test-threads=1 \ No newline at end of file + - name: Run tests on docker + run: docker compose down -v && docker compose run bot t \ No newline at end of file