From 4506854d846759aad72a690b13feddec2019a1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?JN=20Hern=C3=A1ndez?= Date: Fri, 3 May 2024 16:42:14 -0600 Subject: [PATCH] Add GitHub Actions workflow This is the first stage of migrating CI to GitHub Actions. The goal for the CI overall is to compile scala via the update script and run the test script upon merge to develop. Eventually this will integrate wth a GitFlow release process. --- .github/workflows/ci.yml | 45 ++++++++++++++++++++++++++++++++++++++++ scripts/citest | 9 ++++++++ 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100755 scripts/citest diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f5b75ea --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: CI + +on: + push: + branches: + - develop + - hotfix/** + - release/** + - test/** + pull_request: + workflow_dispatch: + +jobs: + compile-then-run-tests: + name: Compile scala, run server, run tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + + - name: Install and configure pipenv + run: | + PYTHON_PATH=$(which python) + pip install pipenv + pipenv --python $PYTHON_PATH + + - name: Run setup script + run: ./scripts/setup + + - name: Run test + run: ./scripts/citest diff --git a/scripts/citest b/scripts/citest new file mode 100755 index 0000000..dbfd90d --- /dev/null +++ b/scripts/citest @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -x + +./scripts/server >gh_output.txt 2>&1 & +sleep 15 +./scripts/test + +# Uncomment following line to see server output in GitHub Actions +# cat gh_output.txt \ No newline at end of file