Skip to content

Commit

Permalink
CI updates
Browse files Browse the repository at this point in the history
This is done by the automated script named upgrade-c2cciutils-to-1.7
  • Loading branch information
sbrunner committed Jun 5, 2024
1 parent d28ee0d commit 8a66f77
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 250 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/changelog.yaml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/codeql.yaml

This file was deleted.

21 changes: 14 additions & 7 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ env:

jobs:
not-failed-backport:
runs-on: ubuntu-22.04
name: Test that's not a failed backport
runs-on: ubuntu-22.04
timeout-minutes: 5

steps:
- run: 'false'
if: github.event.head_commit.message == '[skip ci] Add instructions to finish the backport.'

main:
runs-on: ubuntu-22.04
name: Continuous integration
runs-on: ubuntu-22.04
timeout-minutes: 50
if: "!startsWith(github.event.head_commit.message, '[skip ci] ')"

Expand Down Expand Up @@ -79,7 +80,13 @@ jobs:
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: "pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}\npre-commit-"
- run: pre-commit run --all-files
- run: git diff
- run: git diff --exit-code --patch > /tmp/pre-commit.patch || true
if: failure()
- uses: actions/upload-artifact@v4
with:
name: Apply pre-commit fix.patch
path: /tmp/pre-commit.patch
retention-days: 1
if: failure()
- name: Checks
run: c2cciutils-checks
Expand Down Expand Up @@ -180,17 +187,17 @@ jobs:

- name: Publish Storybook to Chromatic to run visual tests
run: npm run chromatic -- --project-token=$(gopass show gs/ci/chromatic/ngeo_token)
if: env.HAS_SECRETS == 'HAS_SECRETS' && github.event_name == 'push'
env:
NODE_OPTIONS: --openssl-legacy-provider
if: env.HAS_SECRETS == 'HAS_SECRETS' && github.event_name == 'push'
- name: Publish Storybook to Chromatic to run visual tests
run:
GITHUB_SHA=${GITHUB_SHA_} npm run chromatic -- --project-token=$(gopass show gs/ci/chromatic/ngeo_token)
--branch-name=${GITHUB_HEAD_REF}
if: env.HAS_SECRETS == 'HAS_SECRETS' && github.event_name != 'push'
env:
NODE_OPTIONS: --openssl-legacy-provider
GITHUB_SHA_: ${{ steps.sha.outputs.sha }}
if: env.HAS_SECRETS == 'HAS_SECRETS' && github.event_name != 'push'

- name: Notify c2cgeoportal
run: >
Expand Down Expand Up @@ -219,8 +226,8 @@ jobs:
if: env.HAS_SECRETS == 'HAS_SECRETS'

gh-pages:
runs-on: ubuntu-22.04
name: Github Pages
runs-on: ubuntu-22.04
timeout-minutes: 10
concurrency: gh-pages-push
needs:
Expand All @@ -239,9 +246,9 @@ jobs:

- id: branch
run: echo "branch=${GITHUB_REF}" >> $GITHUB_OUTPUT
if: env.HAS_SECRETS == 'HAS_SECRETS'
env:
GITHUB_REF: ${{ github.head_ref || github.ref_name }}
if: env.HAS_SECRETS == 'HAS_SECRETS'

- uses: actions/download-artifact@v3
with:
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/pr-checks.yaml

This file was deleted.

67 changes: 8 additions & 59 deletions .github/workflows/pull-request-automation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
script: |-
console.log(context);
- name: Auto reviews Renovate updates
- name: Auto reviews GHCI updates
uses: actions/github-script@v7
with:
script: |-
Expand All @@ -37,10 +37,13 @@ jobs:
event: 'APPROVE',
})
if: |-
github.event.pull_request.user.login == 'renovate[bot]'
startsWith(github.head_ref, 'ghci/audit/')
&& (github.event.pull_request.user.login == 'ghci-test[bot]'
|| github.event.pull_request.user.login == 'ghci-int[bot]'
|| github.event.pull_request.user.login == 'ghci[bot]')
&& (github.event.action == 'opened'
|| github.event.action == 'reopened')
- name: Auto review and merge snyk auto fix
- name: Auto reviews Renovate updates
uses: actions/github-script@v7
with:
script: |-
Expand All @@ -49,62 +52,8 @@ jobs:
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-2'
&& 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-2'
&& (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.pull_request.user.login == 'renovate[bot]'
&& (github.event.action == 'opened'
|| github.event.action == 'reopened')
71 changes: 0 additions & 71 deletions .github/workflows/test_url.yaml

This file was deleted.

0 comments on commit 8a66f77

Please sign in to comment.