Skip instead of fail workflows (#1997)

This commit is contained in:
Bart Louwers
2024-01-05 21:48:33 +01:00
committed by GitHub
parent a479c84b9b
commit 1811e91e3d
5 changed files with 17 additions and 4 deletions

View File

@@ -40,6 +40,7 @@ jobs:
}
]
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request'
steps:
- uses: actions/checkout@v4
@@ -50,8 +51,6 @@ jobs:
app_id: ${{ secrets.MAPLIBRE_NATIVE_BOT_APP_ID }}
private_key: ${{ secrets.MAPLIBRE_NATIVE_BOT_PRIVATE_KEY }}
- run: echo "${{ toJSON(github.event.workflow_run) }}"
- uses: ./.github/actions/get-pr-number
id: get-pr-number

View File

@@ -216,6 +216,7 @@ jobs:
run: echo version="$(cat VERSION)"-pre${{ github.sha }} >> "$GITHUB_ENV"
- name: Extract changelog for version
if: env.make_release
run: |
awk '/^##/ { p = 0 }; p == 1 { print }; $0 == "## {{ env.version }}" { p = 1 };' CHANGELOG.md > changelog_for_version.md
cat changelog_for_version.md
@@ -275,7 +276,6 @@ jobs:
shell: bash -leo pipefail {0} # so pod is found
if: env.make_release
run: |
zip ${{ env.xcframework }} ../../LICENSE.md # add license to zip
VERSION=${{ env.version }} COCOAPODS_TRUNK_TOKEN=${{ secrets.COCOAPODS_PASSWORD }} pod trunk push MapLibre.podspec
ios-ci-result:

View File

@@ -14,6 +14,7 @@ permissions:
jobs:
pr-bloaty-ios:
if: github.event.workflow_run.event == 'pull_request'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

View File

@@ -13,6 +13,7 @@ on:
jobs:
upload-render-test-result:
runs-on: ubuntu-22.04
if: github.event.workflow_run.event == 'pull_request'
env:
html_filename: "linux-drawable.html"
steps:
@@ -24,9 +25,17 @@ jobs:
- uses: ./.github/actions/download-workflow-run-artifact
with:
artifact-name: render-test-result
expect-files: ${{ env.html_filename }}
# when there are no results, the render test succeeded
# in this case the subsequent steps can be skipped
- name: "Check existence render test results HTML"
id: render_test_results
uses: andstor/file-existence-action@v2.0.0
with:
files: ${{ env.html_filename }}
- name: Configure AWS Credentials
if: steps.render_test_results.outputs.files_exists
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
@@ -34,6 +43,7 @@ jobs:
role-session-name: ${{ github.run_id }}
- name: Upload render test results to S3
if: steps.render_test_results.outputs.files_exists
id: upload_render_test_results
run: |
aws s3 cp metrics/${{ env.html_filename }} \
@@ -41,6 +51,7 @@ jobs:
--expires "$(date -d '+30 days' --utc +'%Y-%m-%dT%H:%M:%SZ')"
- name: 'Leave comment on PR with test results'
if: steps.render_test_results.outputs.files_exists
uses: marocchino/sticky-pull-request-comment@v2
with:
header: render-test-result

View File

@@ -17,6 +17,7 @@ permissions:
jobs:
pr-bloaty:
if: github.event.workflow_run.event == 'pull_request'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
@@ -110,6 +111,7 @@ jobs:
path: message.md
pr-benchmark:
if: github.event.workflow_run.event == 'pull_request'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4