Merge pull request #349 from mynaparrot/room_duration #517
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
redis: | |
image: redis:6 | |
ports: | |
- 6379:6379 | |
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
mariadb: | |
image: mariadb:10.11 | |
env: | |
MYSQL_USER: root | |
MYSQL_DATABASE: plugnmeet | |
MYSQL_ROOT_PASSWORD: 12345 | |
MYSQL_CHARACTER_SET_SERVER: utf8mb4 | |
MYSQL_COLLATION_SERVER: utf8mb4_unicode_ci | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: setup go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '>=1.20' | |
- name: Prepare for test | |
run: | | |
mysql -u root -p12345 -h 127.0.0.1 -P 3306 -D plugnmeet < sql_dump/install.sql | |
git clone https://github.com/mynaparrot/plugNmeet-client client | |
cd client | |
npm install && npm run build | |
- name: Run docker-compose | |
uses: isbang/compose-action@v1.5.1 | |
with: | |
compose-file: "./test/docker-compose.yaml" | |
down-flags: "--volumes" | |
- name: Sleep for 20s | |
uses: juliangruber/sleep-action@v1 | |
with: | |
time: 20s | |
- name: Check logs | |
run: | | |
cd ./test | |
docker ps | |
docker-compose logs | |
- name: Run test | |
#run: go test -cover -race -v ./... | |
run: go test -cover -v ./... |