2024-02-17 11:42:51 +00:00
|
|
|
name: Unit Tests with docker compose and cargo
|
2024-01-29 12:51:05 +00:00
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
unit-test:
|
|
|
|
container:
|
2024-02-17 11:31:32 +00:00
|
|
|
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
|
2024-02-17 11:42:51 +00:00
|
|
|
steps:
|
|
|
|
- name: Starting docker daemon
|
|
|
|
run: docker-init -- dockerd --host=unix:///var/run/docker.sock &
|
|
|
|
- name: Installing necessary packages
|
|
|
|
run: apk add nodejs git curl bash
|
|
|
|
- name: Check out repository code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Get access token from secret
|
|
|
|
run: echo "${{ secrets.MASTODON_SECRET }}" > mastodon-data.toml
|
2024-02-17 12:17:22 +00:00
|
|
|
- name: Restore cached target
|
|
|
|
uses: actions/cache/restore@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
target/
|
2024-02-17 13:14:33 +00:00
|
|
|
key: ${{ runner.os }}-target
|
|
|
|
- run: ls
|
2024-02-17 11:42:51 +00:00
|
|
|
- name: Run tests on docker
|
2024-02-17 12:17:22 +00:00
|
|
|
run: docker compose down -v && docker compose run bot t
|
|
|
|
- name: Save target
|
|
|
|
uses: actions/cache/save@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
target/
|
|
|
|
key: ${{ steps.cache-primes-restore.outputs.cache-primary-key }}
|