-
Notifications
You must be signed in to change notification settings - Fork 480
42 lines (33 loc) · 1.37 KB
/
ci_pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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') }}