Skip to content

Commit

Permalink
Use branch ref in uses, hard code tags for now, tweak var names,
Browse files Browse the repository at this point in the history
clean up a bit
  • Loading branch information
plocket committed Aug 18, 2023
1 parent 82cc1fb commit 215abb0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 34 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/github_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: GitHub server tests

on:
push:
# why is workflow dispatch not showing up in actions?
workflow_dispatch:
inputs:
tags:
Expand All @@ -11,7 +12,7 @@ on:
# They test if env vars get set correctly and depencencies get
# pulled in correctly.
default: '@e6 or @al1'
console_enabled:
enable_tmate:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
Expand All @@ -34,17 +35,18 @@ jobs:
SECRET_FOR_MISSING_FIELD: secret for missing field

steps:
- run: echo "tags are ${{ github.event.inputs.tags }}"
- uses: actions/checkout@v3
- name: Setup tmate session
if: ${{ inputs.enable_tmate == "true" }}
uses: mxschmitt/action-tmate@v3
with:
detached: true
#if: ${{ inputs.console_enabled }}
#with:
# sudo: false
- name: Start the temporary GitHub server
id: github_server
uses: SuffolkLITLab/ALKiln/github_server@start_server_workflow
# TODO: Research how to get this to always be the same branch we're on
# Would ${{ ref or whatever }} work?
uses: SuffolkLITLab/ALKiln/github_server@${{ github.ref }}
with:
CONFIG_CONTENTS: "${{ secrets.CONFIG_CONTENTS }}"
#
Expand All @@ -53,7 +55,7 @@ jobs:
if: ${{ success() }}
# TODO: Research how to get this to always be the same branch we're on
# Would ${{ ref or whatever }} work?
uses: SuffolkLITLab/ALKiln@start_server_workflow
uses: SuffolkLITLab/ALKiln@${{ github.ref }}
with:
SERVER_URL: "${{ steps.github_server.outputs.SERVER_URL }}"
DOCASSEMBLE_DEVELOPER_API_KEY: "${{ steps.github_server.outputs.DOCASSEMBLE_DEVELOPER_API_KEY }}"
Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,14 @@ runs:
if: ${{ inputs.INSTALL_METHOD == 'server' && failure() }}
shell: bash

###########
#### !!! WARNING: RESTORE CODE FOR TAGS
###########
# run tests
- name: "ALKiln: Run tests"
if: ${{ success() }}
run: alkiln-run ${{ github.event.inputs.tags && format('{0}', github.event.inputs.tags) }}
run: alkiln-run @e6 or @al1
#run: alkiln-run ${{ github.event.inputs.tags && format('{0}', github.event.inputs.tags) }}
shell: bash

# on playground, delete project
Expand Down
29 changes: 2 additions & 27 deletions github_server/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,10 @@ inputs:
CONFIG_CONTENTS:
description: "The contents of the config file of the docassemble server"
required: false
# This is necessary to test pre-releases at the very least. It does seem
# strange considering we're controlling everything through the action, but
# that actually doesn't touch the npm version that's pulled in.
#ALKILN_VERSION:
# description: 'Version of ALKiln to get from npm.'
# required: false
# default: '^5.0.0'
MAX_SECONDS_FOR_DOCKER:
description: "Maximum amount of seconds to give the docassemble docker container to serve the site."
required: false
default: 600 # 10 min
#MAX_SECONDS_FOR_SETUP:
# description: "Amount of seconds to give the Project to upload your package's GitHub code."
# required: false
#SERVER_RELOAD_TIMEOUT_SECONDS:
# description: "Max amount of seconds to give the server to reload if it needs to"
# required: false
# # no default to let the custom Scenario timeouts create the reload timeout

outputs:
DOCASSEMBLE_DEVELOPER_API_KEY:
Expand Down Expand Up @@ -53,6 +39,8 @@ runs:
shell: bash
- name: "github_server: Wait for server to start"
run: |
# github_server: Wait for server to start
# Wait 1 minute before pinging the server constantly
sleep 60
Expand Down Expand Up @@ -87,19 +75,6 @@ runs:
done
shell: bash
#- name: "github_server: Install ALKiln"
# run: npm install -g @suffolklitlab/alkiln@${{ inputs.ALKILN_VERSION }}
# shell: bash
#- name: "github_server: Install this package"
# run: alkiln-startserver
# shell: bash
#- name: "github_server: Run Kiln"
# # TODO: Research how to get this to always be the same branch we're on
# # Would ${{ ref or whatever }} work?
# uses: SuffolkLITLab/ALKiln@start_server_workflow
# with:
# SERVER_URL: "http://localhost"
# DOCASSEMBLE_DEVELOPER_API_KEY: "${{ env.DA_ADMIN_API_KEY }}"
- name: Docker logs
if: ${{ always() }}
# TODO: create an arifact for this instead
Expand Down

0 comments on commit 215abb0

Please sign in to comment.