Add BoxLang support to Consumer.cfc #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: CI | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
branches: | |
- master | |
- development | |
pull_request: | |
branches: | |
- development | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
env: | |
MODULE_ID: rabbitsdk | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
services: | |
rabbitmq: | |
image: rabbitmq:latest | |
ports: | |
- 5672:5672 | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Setup Java JDK | |
uses: actions/[email protected] | |
with: | |
# The Java version to make available on the path. Takes a whole or semver Java version, or 1.x syntax (e.g. 1.8 => Java 8.x). Early access versions can be specified in the form of e.g. 14-ea, 14.0.0-ea, or 14.0.0-ea.28 | |
java-version: 11 | |
- name: Install CommandBox | |
run: | | |
curl -fsSl https://downloads.ortussolutions.com/debs/gpg | sudo apt-key add - | |
sudo echo "deb http://downloads.ortussolutions.com/debs/noarch /" | sudo tee -a /etc/apt/sources.list.d/commandbox.list | |
sudo apt-get update && sudo apt-get --assume-yes install rsync jq commandbox | |
box install commandbox-cfconfig,commandbox-dotenv,commandbox-docbox | |
box config set endpoints.forgebox.APIToken=${{ secrets.FORGEBOX_API_KEY }} > /dev/null | |
- name: Do Build | |
run: | | |
# Set Current Version | |
TARGET_VERSION=`cat ${{github.workspace}}/box.json | jq '.version' -r` | |
echo "::set-env name=TARGET_VERSION::$TARGET_VERSION" | |
echo "Starting build for $MODULE_ID v$TARGET_VERSION" | |
# Replace version so builder can issue it | |
box package set [email protected]@[email protected]@ | |
box install | |
cp .env.example .env | |
# Startup the harness | |
cd test-harness | |
# run our dependency install to ensure the workbench is in place | |
box install | |
cd ../ | |
# run our matrix server | |
box server start | |
# Startup the app | |
#- curl http://localhost:60299 | |
# Debugging of tests | |
#- curl http://localhost:60299/tests/runner.cfm?reporter=json -o testresults.json && cat testresults.json | |
# move back to build dir to build it | |
cd ${{github.workspace}} | |
# Build Project | |
box task run taskfile=build/Build target=run :version=$TARGET_VERSION :projectName=$MODULE_ID :buildID=${{github.run_number}} :branch=${{github.ref}} | |
- name: Upload Package to S3 | |
uses: jakejarvis/[email protected] | |
if: | |
contains(' | |
refs/heads/master | |
refs/heads/development | |
', github.ref) | |
with: | |
args: --acl public-read | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }} | |
AWS_S3_BUCKET: downloads.ortussolutions.com | |
SOURCE_DIR: ${{github.workspace}}/.artifacts/$MODULE_ID | |
DEST_DIR: ortussolutions/$MODULE_ID | |
- name: Upload API Docs to S3 | |
uses: jakejarvis/[email protected] | |
if: | |
contains(' | |
refs/heads/master | |
refs/heads/development | |
', github.ref) | |
with: | |
args: --acl public-read | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }} | |
AWS_S3_BUCKET: apidocs.ortussolutions.com | |
SOURCE_DIR: ${{github.workspace}}/.tmp/apidocs | |
DEST_DIR: $MODULE_ID/$TARGET_VERSION | |
- name: Publish to ForgeBox | |
if: | |
contains(' | |
refs/heads/master | |
refs/heads/development | |
', github.ref) | |
run: | | |
cd ${{github.workspace}}/.tmp/${MODULE_ID} | |
cat box.json | |
box forgebox publish | |
- name: On failure | |
if: ${{ failure() }} | |
run: | | |
box server log | |
box system-log | |