From 07734c97a39d2084c452f95ee87dcff5a6fedecb Mon Sep 17 00:00:00 2001 From: Waldemar Hummer Date: Sat, 23 Sep 2023 22:05:21 +0200 Subject: [PATCH] minor enhancements --- action.yml | 24 +++++++++++------------- finish/action.yml | 26 -------------------------- prepare/action.yml | 16 ++++++++++++---- 3 files changed, 23 insertions(+), 43 deletions(-) diff --git a/action.yml b/action.yml index ec44bc7..a0dee5e 100644 --- a/action.yml +++ b/action.yml @@ -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 }}" diff --git a/finish/action.yml b/finish/action.yml index 348c0bc..bb74bd8 100644 --- a/finish/action.yml +++ b/finish/action.yml @@ -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' @@ -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: @@ -38,22 +31,3 @@ runs: body-include: '' 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::$( - # body-include: '' - # number: ${{ steps.pr.outputs.id }} diff --git a/prepare/action.yml b/prepare/action.yml index 21ce9e7..d1276d1 100644 --- a/prepare/action.yml +++ b/prepare/action.yml @@ -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: @@ -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 ...