28 lines
887 B
YAML
28 lines
887 B
YAML
name: Unit Tests with docker compose
|
|
on: [pull_request]
|
|
|
|
jobs:
|
|
unit-test:
|
|
container:
|
|
image: docker:dind
|
|
volumes:
|
|
- /var/lib/docker:/var/lib/docker
|
|
- /
|
|
steps:
|
|
- name: Starting docker daemon
|
|
run: docker-init -- dockerd --host=unix:///var/run/docker.sock &
|
|
- name: Installing necessary packages
|
|
run: apk add npm git curl bash
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v3
|
|
- name: Cache NPM dependencies
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: ~/.npm
|
|
key: ${{ runner.OS }}-npm-cache-${{ hashFiles('**/package.json') }}
|
|
restore-keys: |
|
|
${{ runner.OS }}-npm-cache-
|
|
- name: Install project dependencies
|
|
run: npm install
|
|
- name: Run docker-compose
|
|
run: docker compose down -v && docker compose run bot-api bun test |