Skip to content

Expose time globals to Lua raters and generators #135

Expose time globals to Lua raters and generators

Expose time globals to Lua raters and generators #135

Workflow file for this run

name: CI
on:
push:
branches: [ master, dev ]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
# Skip CI build if this is a tag push (handled by release workflow)
if: startsWith(github.ref, 'refs/tags/') == false
env:
GO111MODULE: on
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.22.x'
- name: Install Dependencies
run: make GOBIN=$HOME/gopath/bin deps
- name: Run Tests
run: make GOBIN=$HOME/gopath/bin test
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Create Python Virtual Environment
run: python -m venv .pyvenv
- name: Run API Unit Tests
run: make api-test
- name: Run Coverage Tests
env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
$HOME/gopath/bin/goveralls -v -service=github
- name: Build Project
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
run: make GOBIN=$HOME/gopath/bin build
- name: Build Docker Image
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
run: docker build -t clintsharp/gogen .
# Deployment steps only run on dev branch; production deploys are handled by release.yml
- name: Configure AWS Credentials
if: github.ref == 'refs/heads/dev'
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: us-east-1
- name: Deploy Build Artifacts to S3
if: github.ref == 'refs/heads/dev'
run: aws s3 sync build s3://gogen-artifacts-staging --delete
- name: Setup Node.js
if: github.ref == 'refs/heads/dev'
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Deploy UI
if: github.ref == 'refs/heads/dev'
run: |
chmod +x ui/deploy_ui.sh
ui/deploy_ui.sh -e staging
deploy-lambdas:
runs-on: ubuntu-latest
needs: build
# Production deploys are handled by release.yml on tagged commits
if: github.ref == 'refs/heads/dev'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.13'
- name: Install AWS SAM CLI
run: |
python -m pip install --upgrade pip
pip install aws-sam-cli boto3 botocore awscli
- name: Configure AWS Credentials
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: us-east-1
- name: Deploy Lambda Functions
env:
ROLE_ARN: ${{ secrets.STAGING_LAMBDA_ROLE_ARN }}
GITHUB_OAUTH_CLIENT_ID: ${{ secrets.STAGING_GITHUB_OAUTH_CLIENT_ID }}
GITHUB_OAUTH_CLIENT_SECRET: ${{ secrets.STAGING_GITHUB_OAUTH_CLIENT_SECRET }}
run: |
cd gogen-api
bash deploy_lambdas.sh -e staging