Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 154 additions & 8 deletions .github/workflows/mandatory-tests.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,157 @@
name: Run mandatory tests
on: pull_request
# Step 6 Github Secrets
name: CI/CD Pipeline

on: [push]

jobs:
build:
test:
runs-on: ubuntu-latest
env:
NODE_ENV: test
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm install
- name: Run mandatory tests
run: npm test -- --selectProjects mandatory
- name: Checkout code
uses: actions/checkout@v3
- name: Install Dependencies
run: npm install
- name: Run tests
run: npm test

deploy:
needs: test
runs-on: ubuntu-latest
env:
NODE_ENV: production
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Deploy
env:
API_KEY: ${{ secrets.API_KEY }} # Access the secret here
run: |
# Use the API_KEY secret in your deployment script
echo "Deploying with API key: $API_KEY"
# Replace the following line with your actual deployment command
# For example: npm deploy
echo "Deployment command here"


# Step 5 Github Environment Variables
# name: CI/CD Pipeline

# on:
# push:

# jobs:
# test:
# runs-on: ubuntu-latest
# env:
# NODE_ENV: test
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Install Dependencies
# run: npm install
# - name: Run tests
# run: npm test

# deploy:
# needs: test
# runs-on: ubuntu-latest
# env:
# NODE_ENV: production
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Deploy
# run: npm deploy

# Step 4 Creating a Workflow with Multiple Jobs
# name: CI/CD Pipeline

# on: [push]

# jobs:
# test:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Install Dependencies
# run: npm install
# - name: Run tests
# run: npm test

# deploy:
# needs: test
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Deploy
# run: npm deploy

# Step 3 Adding Deployment Stages
# name: CI/CD

# on:
# push:

# jobs:
# test:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Install Dependencies
# run: npm install
# - name: Run tests
# run: npm test

# deploy:
# runs-on: ubuntu-latest
# steps:
# - name: Deploy
# run: npm deploy

# Step 2 Adding Testing Stages
# name: CI

# on: [push]

# jobs:
# test:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Install Dependencies
# run: npm install
# - name: Run tests
# run: npm test


# Step 1 Setting up a Simple Workflow
# name: CI

# on: [push]

# jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3

# Original code
# name: Run mandatory tests
# on: pull_request
# jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Install modules
# run: npm install
# - name: Run mandatory tests
# run: npm test -- --selectProjects mandatory