Skip to content

Commit

Permalink
minor enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
whummer committed Sep 23, 2023
1 parent 720c5d9 commit 07734c9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 43 deletions.
24 changes: 11 additions & 13 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,36 +35,34 @@ inputs:
runs:
using: "composite"
steps:
- name: Prepare LocalStack Build
- name: Initial PR comment
uses: LocalStack/setup-localstack/prepare@pr-integration
if: inputs.ci-project && inputs.github-token
with:
github-token: ${{ inputs.github-token }}
ci-project: ${{ inputs.ci-project }}
- name: Finish LocalStack Build
uses: LocalStack/setup-localstack/finish@pr-integration
if: inputs.github-token
with:
github-token: ${{ inputs.github-token }}
ci-project: ${{ inputs.ci-project }}

- run: |
- name: Start LocalStack
run: |
pip install pyopenssl -U
if [ "$USE_PRO" = true ]; then
docker pull localstack/localstack-pro:"$IMAGE_TAG"
docker pull localstack/localstack-pro:"$IMAGE_TAG" &
CONFIGURATION="$CONFIGURATION DNS_ADDRESS=0"
else
docker pull localstack/localstack:"$IMAGE_TAG"
docker pull localstack/localstack:"$IMAGE_TAG" &
fi
pip install localstack
eval "${CONFIGURATION} localstack start -d"
localstack wait -t 30
if [ "$INSTALL_AWSLOCAL" = true ]; then
pip install awscli-local[ver1]
fi
export CI_PROJECT=${{ inputs.ci-project }}
eval "${CONFIGURATION} localstack start -d"
localstack wait -t 30
shell: bash
env:
IMAGE_TAG: "${{ inputs.image-tag }}"
Expand Down
26 changes: 0 additions & 26 deletions finish/action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
name: Finish CI Build

on:
workflow_run:
workflows: ["Run CI Tests"]
types:
- completed

inputs:
github-token:
description: 'Github token used to create PR comments'
Expand All @@ -17,7 +11,6 @@ inputs:
runs:
using: composite
steps:
# if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
- name: Download PR artifact
uses: dawidd6/action-download-artifact@v2
with:
Expand All @@ -38,22 +31,3 @@ runs:
<!-- Sticky Pull Request Comment -->
body-include: '<!-- Sticky Pull Request Comment -->'
number: ${{ steps.pr.outputs.pr_id }}

# failed:
# runs-on: ubuntu-latest
# if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'failure'
# steps:
#
# - name: Save the PR ID
# id: pr
# run: echo "::set-output name=id::$(<pr-id.txt)"
#
# - name: Job failure
# uses: actions-cool/maintain-one-comment@v3.1.1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# body: |
# Deploy PR Preview failed.
# <!-- Sticky Pull Request Comment -->
# body-include: '<!-- Sticky Pull Request Comment -->'
# number: ${{ steps.pr.outputs.id }}
16 changes: 12 additions & 4 deletions prepare/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Start CI Build

on: pull_request_target

inputs:
github_token:
github-token:
description: 'Github token used to create PR comments'
required: true
ci-project:
Expand All @@ -13,10 +11,20 @@ inputs:
runs:
using: composite
steps:
- name: Save PR number
shell: bash
run: echo ${{ github.event.number }} > ./pr-id.txt

- name: Upload PR number
uses: actions/upload-artifact@v3
with:
name: pr
path: ./pr-id.txt

- name: Create initial PR comment
uses: actions-cool/maintain-one-comment@v3.1.1
with:
token: ${{ inputs.github_token }}
token: ${{ inputs.github-token }}
body: |
⚡️ Running CI build with LocalStack ...
<!-- Sticky Pull Request Comment -->
Expand Down

0 comments on commit 07734c9

Please sign in to comment.