Compare commits

...

43 Commits

Author SHA1 Message Date
tom.coursow dfa0d502d3 .gitea/workflows/services.yml aktualisiert
Test Workflow run in Container / test (push) Successful in 18s
Test Gitea Actions with Service Containers / build (push) Successful in 1m14s
2023-07-27 02:47:20 +02:00
tom.coursow db65c4ab7e .gitea/workflows/services.yml aktualisiert
Test Workflow run in Container / test (push) Successful in 7s
Test Gitea Actions with Service Containers / build (push) Successful in 1m14s
2023-07-27 02:34:21 +02:00
tom.coursow d5ea76f225 data/database.js aktualisiert
Test Workflow run in Container / test (push) Successful in 10s
Test Gitea Actions with Service Containers / build (push) Successful in 1m20s
2023-07-27 02:27:02 +02:00
tom.coursow 52807694aa .gitea/workflows/services.yml aktualisiert
Test Workflow run in Container / test (push) Successful in 8s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-27 02:08:00 +02:00
tom.coursow eaf83b4f67 .gitea/workflows/services.yml aktualisiert
Test Workflow run in Container / test (push) Successful in 7s
Test Gitea Actions with Service Containers / build (push) Failing after 7s
2023-07-27 01:48:02 +02:00
tom.coursow 7ec00540f6 .gitea/workflows/services.yml aktualisiert
Test Workflow run in Container / test (push) Successful in 7s
Test Gitea Actions with Service Containers / build (push) Failing after 27s
2023-07-27 01:44:46 +02:00
tom.coursow 866995f66f .gitea/workflows/services.yml aktualisiert
Test Workflow run in Container / test (push) Successful in 7s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-27 01:43:44 +02:00
tom.coursow 62dc1f9c17 .gitea/workflows/services.yml aktualisiert
Test Workflow run in Container / test (push) Successful in 6s
Test Gitea Actions with Service Containers / build (push) Failing after 6s
2023-07-27 01:40:21 +02:00
tom.coursow 8b2c84f4d7 .gitea/workflows/services.yml aktualisiert
Test Workflow run in Container / test (push) Successful in 7s
Test Gitea Actions with Service Containers / build (push) Failing after 8s
2023-07-27 01:37:43 +02:00
tom.coursow 09c8d20a3b .gitea/workflows/services.yml aktualisiert
Test Workflow run in Container / test (push) Successful in 10s
Test Gitea Actions with Service Containers / build (push) Failing after 12s
2023-07-27 01:31:54 +02:00
tom.coursow a8c9edab78 data/database.js aktualisiert
Test Workflow run in Container / test (push) Successful in 8s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 20:43:23 +02:00
tom.coursow b871a52259 data/database.js aktualisiert
Test Workflow run in Container / test (push) Successful in 8s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 20:40:02 +02:00
tom.coursow 30308552b1 .gitea/workflows/services.yml aktualisiert
Test Workflow run in Container / test (push) Successful in 8s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 20:32:29 +02:00
tom.coursow 10b73ce74e .gitea/workflows/services.yml aktualisiert
Test Workflow run in Container / test (push) Successful in 8s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 20:30:31 +02:00
tom.coursow 7af6e3bd99 .gitea/workflows/services.yml aktualisiert
Test Gitea Actions with Service Containers / build (push) Has been cancelled
Test Workflow run in Container / test (push) Successful in 8s
2023-07-17 20:29:30 +02:00
tom.coursow 698a01cfe9 .gitea/workflows/services.yml aktualisiert
Test Workflow run in Container / test (push) Successful in 8s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 20:28:14 +02:00
tom.coursow 66e2fda0ae README.md aktualisiert
Test Workflow run in Container / test (push) Successful in 9s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 20:23:21 +02:00
tom.coursow b18fe2c207 README.md aktualisiert 2023-07-17 20:22:44 +02:00
tom.coursow 09b3ee9b10 Update .gitea/workflows/services.yml
Test Workflow run in Container / test (push) Successful in 8s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 20:16:55 +02:00
tom.coursow ad94a6ab07 Update .gitea/workflows/services.yml
Test Workflow run in Container / test (push) Successful in 9s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 20:14:57 +02:00
tom.coursow 3e59f023a1 Update .gitea/workflows/services.yml
Test Workflow run in Container / test (push) Successful in 8s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 20:03:17 +02:00
tom.coursow 2d199bb143 Update .gitea/workflows/services.yml
Test Workflow run in Container / test (push) Successful in 9s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 19:59:34 +02:00
tom.coursow 49c211d372 Update .gitea/workflows/services.yml
Test Workflow run in Container / test (push) Successful in 8s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 19:47:40 +02:00
tom.coursow 542670be57 Update .gitea/workflows/services.yml
Test Workflow run in Container / test (push) Successful in 9s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 19:43:08 +02:00
tom.coursow f16a32a0ae Update .gitea/workflows/services.yml
Test Workflow run in Container / test (push) Successful in 12s
Test Gitea Actions with Service Containers / build (push) Failing after 12m22s
2023-07-17 18:50:01 +02:00
tom.coursow ecb3eebd1b Update .gitea/workflows/services.yml
Test Workflow run in Container / test (push) Successful in 9s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 18:19:06 +02:00
tom.coursow d034e49b02 Update .gitea/workflows/services.yml
Test Workflow run in Container / test (push) Successful in 8s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 18:14:01 +02:00
tom.coursow cee0cea3e7 Update README.md
Test Workflow run in Container / test (push) Successful in 8s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 18:01:19 +02:00
tom.coursow 31d9e194c9 Update data/database.js
Test Workflow run in Container / test (push) Successful in 9s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 17:54:53 +02:00
tom.coursow 26d00748a1 Update .gitea/workflows/services.yml
Test Workflow run in Container / test (push) Successful in 9s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 17:44:06 +02:00
tom.coursow ea0a82b3ad Update .gitea/workflows/services.yml
Test Workflow run in Container / test (push) Successful in 9s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 17:37:09 +02:00
tom.coursow 55fe3cbe29 Update README.md
Test Workflow run in Container / test (push) Successful in 8s
Test Gitea Actions with Service Containers / build (push) Failing after 0s
2023-07-17 17:36:25 +02:00
tom.coursow 7f5b9df217 Update .gitea/workflows/services.yml
Test Workflow run in Container / test (push) Has been cancelled
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 17:28:13 +02:00
tom.coursow 81c4488efa Update .gitea/workflows/services.yml
Test Workflow run in Container / test (push) Successful in 10s
Test Gitea Actions with Service Containers / build (push) Failing after 12m31s
2023-07-17 17:09:59 +02:00
tom.coursow 973e9268f8 Update .gitea/workflows/services.yml
Test Workflow run in Container / test (push) Successful in 7s
Test Gitea Actions with Service Containers / build (push) Failing after 12s
2023-07-17 17:08:17 +02:00
tom.coursow a376edc368 Update .gitea/workflows/services.yml
Test Workflow run in Container / test (push) Successful in 7s
Test Gitea Actions with Service Containers / build (push) Failing after 8s
2023-07-17 17:06:20 +02:00
tom.coursow b77264eae6 Update .gitea/workflows/services.yml
Test Gitea Actions with Service Containers / build (push) Failing after 10s
Test Workflow run in Container / test (push) Successful in 9s
2023-07-17 17:03:51 +02:00
tom.coursow 817b3be213 Update .gitea/workflows/services.yml
Test Workflow run in Container / test (push) Successful in 9s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 17:00:00 +02:00
tom.coursow a02ff2f975 Update .gitea/workflows/services.yml
Test Workflow run in Container / test (push) Successful in 7s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 16:56:32 +02:00
tom.coursow 5af6fee1eb Update data/database.js
Test Workflow run in Container / test (push) Successful in 8s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 16:53:45 +02:00
tom.coursow fac4aa465f Update .gitea/workflows/services.yml
Test Workflow run in Container / test (push) Successful in 8s
Test Gitea Actions with Service Containers / build (push) Has been cancelled
2023-07-17 16:47:58 +02:00
tom.coursow e51521680e Update .gitea/workflows/services.yml
Test Gitea Actions with Service Containers / build (push) Has been cancelled
Test Workflow run in Container / test (push) Successful in 7s
2023-07-17 16:43:29 +02:00
tom.coursow c68b604daa Update .gitea/workflows/services.yml
Test Workflow run in Container / test (push) Successful in 10s
Test Gitea Actions with Service Containers / build (push) Failing after 2s
2023-07-17 16:41:40 +02:00
2 changed files with 20 additions and 13 deletions
+17 -10
View File
@@ -1,36 +1,43 @@
name: Test Gitea Actions with Service Containers
on:
push:
branches:
- master
on: push
env:
# Global Env Variables readable in all jobs of this workflow
MONGODB_CLUSTER_ADDRESS: mongodb
MONGODB_CLUSTER_ADDRESS: mongodb # The network alias name of the mongodb docker service container
# Env Variables which the Example JS App will access
MONGODB_USERNAME: root
MONGODB_PASSWORD: supersecretpassword
MONGODB_DB_NAME: actions-environment
MONGODB_DB_NAME: actionsenvironment
PORT: 8080
jobs:
build:
# Job will execute the Steps inside a 'node:latest' docker container
container:
image: node:latest
runs-on: ubuntu-latest
services:
# Before running the Steps of this job...
# The runner will spawm a second container 'mongodb' using the mongo:latest image with some db settings
# The node container and the mongodb container will be in a new temporary docker bridge network
mongodb:
image: mongodb
image: mongo:latest
# Docker related container env Variables for the mongo image (JS App will not have these variables)
env:
MONGO_INITDB_DATABASE: actionsenvironment
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: Get Code
uses: actions/checkout@v3
- name: Install dependencies
run: npm ci
- name: Run server
run: npm start & npx wait-on http://127.0.0.1:$WEB_PORT
run: npm start & npx wait-on http://127.0.0.1:$PORT
- name: Run tests
run: npm test
+3 -3
View File
@@ -1,21 +1,21 @@
import { MongoClient } from 'mongodb';
const connectionProtocol = process.env.MONGODB_CONNECTION_PROTOCOL;
const clusterAddress = process.env.MONGODB_CLUSTER_ADDRESS;
const dbUser = process.env.MONGODB_USERNAME;
const dbPassword = process.env.MONGODB_PASSWORD;
const dbName = process.env.MONGODB_DB_NAME;
const uri = `${connectionProtocol}://${dbUser}:${dbPassword}@${clusterAddress}/?retryWrites=true&w=majority`;
const uri = `mongodb://${dbUser}:${dbPassword}@${clusterAddress}/?retryWrites=true&w=majority`;
const client = new MongoClient(uri);
console.log('Trying to connect to db');
console.log('Trying to connect to db: ' + uri);
try {
await client.connect();
await client.db(dbName).command({ ping: 1 });
console.log('Connected successfully to server');
} catch (error) {
console.log(error)
console.log('Connection failed.');
await client.close();
console.log('Connection closed.');