name: Test Gitea Actions with Service Containers on: push env: # Global Env Variables readable in all jobs of this workflow MONGODB_CLUSTER_ADDRESS: mongo.coursow.de MONGODB_USERNAME: root MONGODB_PASSWORD: supersecretpassword MONGODB_DB_NAME: actions-environment PORT: 8080 jobs: build: container: image: node:latest runs-on: ubuntu-latest services: mongodb: image: mongo:latest ports: - 27017:27017 env: MONGO_INITDB_ROOT_USERNAME: root MONGO_INITDB_ROOT_PASSWORD: supersecretpassword steps: - 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:$PORT - name: Run tests run: npm test