Added test project requiring mongodb and added new workflow to test Gitea Actions - Service Containers

This commit is contained in:
2023-07-17 16:39:34 +02:00
parent e833c393fb
commit 5c635fd321
12 changed files with 1650 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
name: Test Gitea Actions with Service Containers
on:
push:
branches:
- master
env:
# Global Env Variables readable in all jobs of this workflow
MONGODB_CLUSTER_ADDRESS: mongodb
MONGODB_USERNAME: root
MONGODB_PASSWORD: supersecretpassword
MONGODB_DB_NAME: actions-environment
PORT: 8080
jobs:
build:
runs-on: ubuntu-latest
services:
mongodb:
image: mongodb
env:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: supersecretpassword
steps:
- name: Get Code
uses: actions/checkout@v3
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Run server
run: npm start & npx wait-on http://127.0.0.1:$WEB_PORT
- name: Run tests
run: npm test