bot-api/.gitea/workflows/test.yaml

25 lines
943 B
YAML
Raw Normal View History

name: Unit Tests with docker compose
2023-12-25 13:40:10 +00:00
on: [pull_request]
2023-12-25 13:36:13 +00:00
jobs:
unit-test:
2023-12-29 08:44:40 +00:00
container:
image: docker:dind
2024-01-06 16:53:35 +00:00
volumes:
- /root:/root
2024-01-06 17:32:00 +00:00
- /var/lib/docker/image:/var/lib/docker/image
2024-01-06 17:43:06 +00:00
- /var/lib/docker/overlay2:/var/lib/docker/overlay2
2023-12-25 13:36:13 +00:00
steps:
- name: Starting docker daemon
run: docker-init -- dockerd --host=unix:///var/run/docker.sock &
- name: Installing necessary packages
2024-01-06 17:57:09 +00:00
run: apk add nodejs git curl bash patchelf
2023-12-25 13:36:13 +00:00
- name: Check out repository code
uses: actions/checkout@v3
2024-01-06 17:51:44 +00:00
- name: Install bun.sh
if: ${{ hashFiles('~/.bun/bin/bun') == '' }}
2024-01-06 17:55:18 +00:00
run: curl https://raw.githubusercontent.com/LowByteFox/bun-musl/main/bun-musl -o bun-musl && bash bun-musl install
- name: Install project dependencies
run: ~/.bun/bin/bun i
- name: Run docker-compose
run: docker compose down -v && docker compose run bot-api bun test