Skip to content

CI Pipeline

CI Pipeline #39

Workflow file for this run

name: CI Pipeline
on:
workflow_dispatch:
# Add additional trigger events as needed (e.g., push, pull_request, etc.)
env:
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
MYSQL_ROOT_PASSWORD: root
jobs:
build-and-test:
runs-on: ubuntu-latest
if: github.actor == 'pablo-code-org'
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
path: code-dot-org
- name: Prepare entrypoint script
run: cp ./code-dot-org/docker/dockerfiles/entrypoint.sh ./code-dot-org/
- name: Set up Docker Environment
run: docker build --build-arg MYSQL_GPG_KEY_FILE=mysql.gpg -t code-dot-org-testing-docker-image -f ./code-dot-org/docker/dockerfiles/Dockerfile ./code-dot-org
- name: Run Unit Tests
run: |
docker run code-dot-org-testing-docker-image /bin/bash -c "source /home/runner/work/code-dot-org/code-dot-org/docker/unit_tests.sh"
- name: Run UI Tests
run: |
docker run code-dot-org-testing-docker-image /bin/bash -c "source /home/runner/work/code-dot-org/code-dot-org/docker/ui_tests.sh"
- name: Update Cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}