-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3164 from mapfish/c2cciutils-upgrade
CI updates
- Loading branch information
Showing
11 changed files
with
191 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,9 @@ env: | |
|
||
jobs: | ||
main: | ||
name: Continuous integration | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 30 | ||
name: Continuous integration | ||
if: "!startsWith(github.event.head_commit.message, '[skip ci] ')" | ||
|
||
steps: | ||
|
@@ -101,9 +101,8 @@ jobs: | |
if-no-files-found: ignore | ||
if: always() | ||
|
||
- run: make tests | ||
# Tntented to fail earlier than the standard 30min for workflow failure | ||
timeout-minutes: 10 | ||
- timeout-minutes: 10 | ||
run: make tests | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
|
@@ -148,63 +147,63 @@ jobs: | |
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ steps.tag.outputs.tag }} | ||
draft: false | ||
prerelease: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: startsWith(github.ref, 'refs/tags/') && env.HAS_SECRETS == 'HAS_SECRETS' | ||
- name: Upload Release Asset | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./core/build/libs/print-servlet-${{ steps.version.outputs.version }}.war | ||
asset_name: print-servlet-${{ steps.version.outputs.version }}.war | ||
asset_content_type: application/java-archive | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: startsWith(github.ref, 'refs/tags/') && env.HAS_SECRETS == 'HAS_SECRETS' | ||
- name: Upload Release Asset | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./core/build/distributions/core-${{ steps.version.outputs.version }}.zip | ||
asset_name: print-cli-${{ steps.version.outputs.version }}.zip | ||
asset_content_type: application/zip | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: startsWith(github.ref, 'refs/tags/') && env.HAS_SECRETS == 'HAS_SECRETS' | ||
- name: Upload Release Asset | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./core/build/libs/print-lib-${{ steps.version.outputs.version }}.jar | ||
asset_name: print-lib-${{ steps.version.outputs.version }}.jar | ||
asset_content_type: application/java-archive | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: startsWith(github.ref, 'refs/tags/') && env.HAS_SECRETS == 'HAS_SECRETS' | ||
- name: Upload Release Asset | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./core/build/libs/print-lib-${{ steps.version.outputs.version }}-sources.jar | ||
asset_name: print-lib-${{ steps.version.outputs.version }}-sources.jar | ||
asset_content_type: application/java-archive | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: startsWith(github.ref, 'refs/tags/') && env.HAS_SECRETS == 'HAS_SECRETS' | ||
- name: Upload Release Asset | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./core/build/libs/print-lib-${{ steps.version.outputs.version }}-javadoc.jar | ||
asset_name: print-lib-${{ steps.version.outputs.version }}-javadoc.jar | ||
asset_content_type: application/java-archive | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: startsWith(github.ref, 'refs/tags/') && env.HAS_SECRETS == 'HAS_SECRETS' | ||
|
||
# Update the documentation | ||
|
@@ -238,8 +237,8 @@ jobs: | |
if (process.env.GITHUB_REF_TYPE == 'tag') { | ||
console.log('Trigger changelog'); | ||
await github.rest.repos.createDispatchEvent({ | ||
owner: 'camptocamp', | ||
repo: 'helm-mutualize', | ||
owner: 'mapfish', | ||
repo: 'mapfish-print', | ||
event_type: 'changelog', | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
name: Auto reviews, merge and close pull requests | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- closed | ||
pull_request_target: | ||
types: | ||
- closed | ||
|
||
jobs: | ||
auto-merge: | ||
name: Auto reviews, merge and close pull requests | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- name: Print event | ||
run: echo "${GITHUB}" | jq | ||
env: | ||
GITHUB: ${{ toJson(github) }} | ||
- name: Print context | ||
uses: actions/github-script@v7 | ||
with: | ||
script: |- | ||
console.log(context); | ||
- name: Auto reviews Renovate updates | ||
uses: actions/github-script@v7 | ||
with: | ||
script: |- | ||
github.rest.pulls.createReview({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: context.payload.pull_request.number, | ||
event: 'APPROVE', | ||
}) | ||
if: |- | ||
github.event.pull_request.user.login == 'renovate[bot]' | ||
&& (github.event.action == 'opened' | ||
|| github.event.action == 'reopened') | ||
- name: Auto review and merge dpkg updates | ||
uses: actions/github-script@v7 | ||
with: | ||
script: |- | ||
github.rest.pulls.createReview({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: context.payload.pull_request.number, | ||
event: 'APPROVE', | ||
}); | ||
github.graphql(` | ||
mutation { | ||
enablePullRequestAutoMerge(input: { | ||
pullRequestId: "${context.payload.pull_request.node_id}", | ||
mergeMethod: SQUASH, | ||
}) { | ||
pullRequest { | ||
autoMergeRequest { | ||
enabledAt | ||
} | ||
} | ||
} | ||
} | ||
`) | ||
if: |- | ||
github.event.pull_request.user.login == 'c2c-bot-gis-ci' | ||
&& startsWith(github.head_ref, 'dpkg-update/') | ||
&& (github.event.action == 'opened' | ||
|| github.event.action == 'reopened') | ||
- name: Auto review and merge snyk auto fix | ||
uses: actions/github-script@v7 | ||
with: | ||
script: |- | ||
github.rest.pulls.createReview({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: context.payload.pull_request.number, | ||
event: 'APPROVE', | ||
}); | ||
github.graphql(` | ||
mutation { | ||
enablePullRequestAutoMerge(input: { | ||
pullRequestId: "${context.payload.pull_request.node_id}", | ||
mergeMethod: SQUASH, | ||
}) { | ||
pullRequest { | ||
autoMergeRequest { | ||
enabledAt | ||
} | ||
} | ||
} | ||
} | ||
`) | ||
if: |- | ||
github.event.pull_request.user.login == 'c2c-bot-gis-ci' | ||
&& startsWith(github.head_ref, 'snyk-fix/') | ||
&& (github.event.action == 'opened' | ||
|| github.event.action == 'reopened') | ||
- name: Restart audit workflow | ||
uses: actions/github-script@v7 | ||
with: | ||
script: |- | ||
let runs = await github.rest.actions.listWorkflowRuns({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
workflow_id: 'audit.yaml', | ||
per_page: 1, | ||
}); | ||
runs = runs.data.workflow_runs; | ||
if (runs.length == 1 && runs[0].status != 'success') { | ||
console.log(`Rerun workflow ${runs[0].id} ${runs[0].status}`); | ||
github.rest.actions.reRunWorkflowFailedJobs({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: runs[0].id, | ||
}); | ||
} | ||
if: |- | ||
github.event.pull_request.user.login == 'c2c-bot-gis-ci' | ||
&& (startsWith(github.head_ref, 'snyk-fix/') | ||
|| startsWith(github.head_ref, 'dpkg-update/')) | ||
&& github.event.action == 'closed' | ||
&& github.event.pull_request.merged == true | ||
- name: Auto close pre-commit.ci autoupdate | ||
uses: actions/github-script@v7 | ||
with: | ||
script: |- | ||
github.rest.pulls.update({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: context.payload.pull_request.number, | ||
state: 'closed', | ||
}); | ||
if: |- | ||
github.event.pull_request.user.login == 'pre-commit-ci' | ||
&& (github.event.action == 'opened' | ||
|| github.event.action == 'reopened') |
Oops, something went wrong.