gitea-actions-playground/.gitea/workflows/default.yml
Martin Below 2170f0d03b
Some checks failed
Build Project / TestWithDb (push) Failing after 1s
ci config
2024-06-10 10:24:32 +02:00

32 lines
1.1 KiB
YAML

name: Build Project
on: [push]
jobs:
TestWithDb:
runs-on: ubuntu-latest
services:
db:
image: mariadb:11.4.2-ubi9
ports:
- 3306:3306
environment:
MARIADB_DATABASE: "test"
MARIADB_USER: "test"
MARIADB_PASSWORD: "test"
MARIADB_ROOT_PASSWORD: root
MARIADB_MYSQL_LOCALHOST_GRANTS: "test"
steps:
- name: debug
run echo "username: ${{ gitea.actor }}"
run echo "password: ${{ secrets.GITEA_TOKEN }}"
- name: install netcat
run: apt-get -y update ; apt -y install netcat-openbsd
- name: install mariadb server
run: apt-get -y update ; apt-get -y install mariadb-server
- name: start mariadb server
run: mkdir /var/run/mysqld ; chown mysql:mysql /var/run/mysqld ; su mysql -s /bin/bash -c mariadbd &
- name: create database and user
run: echo "create database wazzl; create user wazzl identified by 'wazzl'; grant all privileges on wazzl.* to wazzl;" | su mysql -s /bin/bash -c mysql
- name: try to connect to db
run: nc -w5 -z -v localhost 3306 || nc -w5 -z -v db 3306