Skip to content

Commit

Permalink
Skip instead of fail workflows (#1997)
Browse files Browse the repository at this point in the history
  • Loading branch information
louwers authored Jan 5, 2024
1 parent a479c84 commit 1811e91
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/android-device-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
}
]
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request'
steps:
- uses: actions/checkout@v4

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-bloaty-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/pr-render-test-result.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -24,23 +25,33 @@ 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/[email protected]
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
role-to-assume: ${{ vars.OIDC_AWS_ROLE_TO_ASSUME }}
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 }} \
s3://maplibre-native-test-artifacts/${{ github.run_id }}-${{ env.html_filename }} \
--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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1811e91

Please sign in to comment.