Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PC-32458) chore(pipeline): notify either it worked or failed #7030

Merged
merged 3 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "1 [on_dispatch][Jira] Create/Push ehp deploy tags"
name: '1 [on_dispatch][Jira] Create/Push ehp deploy tags'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il me semble qu'en YAML sauf certains cas particuliers (yes / no par exemple) on peut se passer des quotes. Donc pour moi on pourrait les supprimer carrément

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

j'ai la flemme de repasser sur tout les workflows à la main

c'était une modification automatique (voir premier commit)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oui je comprends :)

on:
workflow_dispatch:
Expand All @@ -21,19 +21,19 @@ jobs:
name: 'Create and push staging tag'
runs-on: ubuntu-22.04
steps:
- name: "Checkout commit hash"
- name: 'Checkout commit hash'
uses: actions/checkout@v4
with:
ref: ${{ inputs.commitHash }}
token: ${{ secrets.PUSH_SERVICE_ACCOUNT }}
- name: "get package version"
- name: 'get package version'
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: "Author"
- name: 'Author'
run: |
git config --global user.email "$GIT_CONFIG_EMAIL"
git config --global user.name "$GIT_CONFIG_NAME"
- name: "Create and push tag from package version"
- name: 'Create and push tag from package version'
id: create_tag
run: |
STAGING_VERSION=${{ steps.package-version.outputs.current-version }}
Expand All @@ -48,11 +48,11 @@ jobs:
with:
ref: master
token: ${{ secrets.PUSH_SERVICE_ACCOUNT }}
- name: "Author"
- name: 'Author'
run: |
git config --global user.email "$GIT_CONFIG_EMAIL"
git config --global user.name "$GIT_CONFIG_NAME"
- name: "Bump package version"
- name: 'Bump package version'
uses: phips28/gh-action-bump-version@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -62,7 +62,7 @@ jobs:
skip-commit: 'true'
skip-tag: 'true'
skip-push: 'true'
- name: "Bump server package version"
- name: 'Bump server package version'
uses: phips28/gh-action-bump-version@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -73,10 +73,10 @@ jobs:
skip-commit: 'true'
skip-tag: 'true'
skip-push: 'true'
- name: "Get package version"
- name: 'Get package version'
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: "Bump build number"
- name: 'Bump build number'
id: build-number
run: |
# We have to increment the build number because it is used as the versionCode
Expand Down Expand Up @@ -104,20 +104,20 @@ jobs:
PATCH=${SEMVER[2]}
BUILD_NUMBER=$((10000000 * MAJOR + 1000 * MINOR + PATCH))
echo build_number=$BUILD_NUMBER >> $GITHUB_OUTPUT
- name: "Update build number in package.json"
- name: 'Update build number in package.json'
uses: sergeysova/jq-action@v2
with:
cmd: jq '.build = ${{ steps.build-number.outputs.build_number }}' package.json > tmp && mv tmp package.json
- name: "Get routes used by app version"
- name: 'Get routes used by app version'
run: |
./scripts/get_used_routes.sh "v${TESTING_VERSION}"
- name: "Commit changes"
- name: 'Commit changes'
run: |
TESTING_VERSION=${{ steps.package-version.outputs.current-version }}
git add package.json server/package.json route_usage_changelog.md
git commit --message "v${TESTING_VERSION}"
git push origin master
- name: "Create and push testing tag"
- name: 'Create and push testing tag'
run: |
TESTING_VERSION=${{ steps.package-version.outputs.current-version }}
TAG_NAME=testing/v${TESTING_VERSION}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dev_on_dispatch_service_worker_test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "1 [on_dispatch] Service Worker Test"
name: '1 [on_dispatch] Service Worker Test'

on:
workflow_dispatch:
Expand All @@ -8,7 +8,7 @@ on:
required: true
type: string
versionTo:
description: "Nom de la nouvelle release (ex: 1.200.0)"
description: 'Nom de la nouvelle release (ex: 1.200.0)'
required: true
type: string
repository_dispatch:
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Setup Node.JS
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
node-version-file: '.nvmrc'

# Necessary for the latest service worker test script
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev_on_pull_request_reassure.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "3 [on_pr] Run Reassure performance tests"
name: '3 [on_pr] Run Reassure performance tests'

on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev_on_pull_request_title_checker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "3 [on_pr] Check PR title format"
name: '3 [on_pr] Check PR title format'

on:
pull_request:
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/dev_on_push_workflow_main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: "2 [pull/pr] Initiate workflow"
name: '2 [pull/pr] Initiate workflow'

on:
push:
branches:
- master
tags:
- "**"
- '**'
pull_request:

permissions:
Expand Down Expand Up @@ -266,7 +266,12 @@ jobs:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
deploy-web-proxy-integration:
needs: [check-server-folder-changes-production, deploy-web-integration, check-proxy-version-production]
needs:
[
check-server-folder-changes-production,
deploy-web-integration,
check-proxy-version-production,
]
if: needs.check-server-folder-changes-production.outputs.folder_changed == 'true' && needs.check-proxy-version-production.outputs.proxy_base_tag
uses: ./.github/workflows/dev_on_workflow_web_proxy_deploy.yml
with:
Expand All @@ -287,7 +292,12 @@ jobs:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
deploy-web-proxy-production:
needs: [check-server-folder-changes-production, deploy-web-production, check-proxy-version-production]
needs:
[
check-server-folder-changes-production,
deploy-web-production,
check-proxy-version-production,
]
if: needs.check-server-folder-changes-production.outputs.folder_changed == 'true' && needs.check-proxy-version-production.outputs.proxy_base_tag
uses: ./.github/workflows/dev_on_workflow_web_proxy_deploy.yml
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "4 [on_workflow] Check folder changes"
name: '4 [on_workflow] Check folder changes'

on:
workflow_call:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dev_on_workflow_check_proxy_version.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "4 [on_workflow] Check proxy version"
name: '4 [on_workflow] Check proxy version'

on:
workflow_call:
Expand Down Expand Up @@ -35,7 +35,7 @@ jobs:
run: echo proxy_version=$(curl -sS ${{ inputs.WEBAPP_URL }}/version.txt) >> $GITHUB_OUTPUT

# The rollback protection use semver-compare-cli from npmregistry, exemple of comparaison
#
#
# semver-compare 1.0.0 ge 1.0.1 => exit 1
# semver-compare 1.0.1 ge 1.0.0 => exit 0
# semver-compare 1.0.0 ge 1.0.0 => exit 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev_on_workflow_chromatic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "4 [on_workflow] Build, test and deploy storybook with Chromatic"
name: '4 [on_workflow] Build, test and deploy storybook with Chromatic'

on:
workflow_call:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ jobs:
SLACK_BOT_TOKEN:passculture-metier-ehp/passculture-ci-slack-bot-token
- name: Post to a Slack channel
id: slack
if: ${{ steps.sentry_and_deploy.outputs.status == 'failure' || inputs.ENV == 'staging' }}
uses: slackapi/slack-github-action@v1.24.0
with:
# channel #alertes-deploiement-native
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "4 [on_workflow] iOS deploy"
name: '4 [on_workflow] iOS deploy'

on:
workflow_call:
Expand All @@ -17,7 +17,7 @@ on:

jobs:
sentry_and_deploy:
name: "Install runtime environment and dependencies iOS deploy"
name: 'Install runtime environment and dependencies iOS deploy'
runs-on: macos-14
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -111,7 +111,6 @@ jobs:
SLACK_BOT_TOKEN:passculture-metier-ehp/passculture-ci-slack-bot-token
- name: Post to a Slack channel
id: slack
if: ${{ steps.sentry_and_deploy.outputs.status == 'failure' || inputs.ENV == 'staging' }}
uses: slackapi/slack-github-action@v1.24.0
with:
# channel #alertes-deploiement-native
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "4 [on_workflow] Soft deploy"
name: '4 [on_workflow] Soft deploy'

on:
workflow_call:
Expand All @@ -17,7 +17,7 @@ on:

jobs:
sentry_and_deploy:
name: "Install runtime environment and dependencies Soft deploy"
name: 'Install runtime environment and dependencies Soft deploy'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -102,7 +102,6 @@ jobs:
SLACK_BOT_TOKEN:passculture-metier-ehp/passculture-ci-slack-bot-token
- name: Post to a Slack channel
id: slack
if: ${{ steps.sentry_and_deploy.outputs.status == 'failure' || inputs.ENV == 'staging' }}
uses: slackapi/slack-github-action@v1.24.0
with:
# channel #alertes-deploiement-native
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/dev_on_workflow_install.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "4 [on_workflow] Install dependencies"
name: '4 [on_workflow] Install dependencies'

on:
workflow_call:
Expand All @@ -14,7 +14,7 @@ on:

jobs:
yarn-install:
name: "Install yarn dependencies"
name: 'Install yarn dependencies'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -29,7 +29,7 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- id: gcloud-auth
name: "OpenID Connect Authentication"
name: 'OpenID Connect Authentication'
uses: 'google-github-actions/auth@v2'
with:
cleanup_credentials: false
Expand All @@ -49,7 +49,7 @@ jobs:
v1-yarn-dependency-cache-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
key-file-name: ${{ steps.gcloud-auth.outputs.credentials_file_path }}
bucket: ${{ inputs.CACHE_BUCKET_NAME }}
- name: "Use the artifact registry"
- name: 'Use the artifact registry'
uses: pass-culture-github-actions/artifact-registry@v1.0.0
with:
secret-workload-identity-provider-artifact-registry: passculture-metier-ehp/passculture-main-gcp-workload-identity-provider
Expand All @@ -61,7 +61,7 @@ jobs:
run: yarn install

bundle-install:
name: "Install runtime environment"
name: 'Install runtime environment'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev_on_workflow_linter_ts.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "4 [on_workflow] Verify code lint and typescript"
name: '4 [on_workflow] Verify code lint and typescript'

on:
workflow_call:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev_on_workflow_tester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ jobs:
"attachments": [
{
"mrkdwn_in": ["text"],
"color": "${{ fromJSON('["#36a64f", "#A30002"]')[ env.WORKFLOW_CONCLUSION == 'failure'] }}",
"color": "#A30002",
"author_name": "${{github.actor}}",
"author_link": "https://github.com/${{github.actor}}",
"author_icon": "https://github.com/${{github.actor}}.png",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "4 [on_workflow] Check no ts-expect-error noUncheckedIndexedAccess in introduced"
name: '4 [on_workflow] Check no ts-expect-error noUncheckedIndexedAccess in introduced'

on:
workflow_call:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev_on_workflow_ts_prune.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "4 [on_workflow] Check no dead code is introduced"
name: '4 [on_workflow] Check no dead code is introduced'

on:
workflow_call:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev_on_workflow_update_jira_issues.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "4 [on_workflow] Update jira issues"
name: '4 [on_workflow] Update jira issues'

on:
workflow_call:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/dev_on_workflow_web_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ jobs:
SLACK_BOT_TOKEN:passculture-metier-ehp/passculture-ci-slack-bot-token
- name: Post to a Slack channel
id: slack
if: ${{ steps.web_deploy.outputs.status == 'failure' || inputs.ENV == 'staging' }}
uses: slackapi/slack-github-action@v1.24.0
with:
# channel #alertes-deploiement-native
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/dev_on_workflow_web_proxy_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "4 [on_workflow] Deploy web proxy"
name: '4 [on_workflow] Deploy web proxy'

on:
workflow_call:
Expand Down Expand Up @@ -30,7 +30,7 @@ jobs:
with:
node-version-file: 'server/.nvmrc'
- id: gcloud-auth
name: "OpenID Connect Authentication"
name: 'OpenID Connect Authentication'
uses: 'google-github-actions/auth@v2'
with:
cleanup_credentials: false
Expand Down Expand Up @@ -90,7 +90,6 @@ jobs:
SLACK_BOT_TOKEN:passculture-metier-ehp/passculture-ci-slack-bot-token
- name: Post to a Slack channel
id: slack
if: ${{ steps.web_proxy_deploy.outputs.status == 'failure' || inputs.ENV == 'staging' }}
uses: slackapi/slack-github-action@v1.24.0
with:
# channel #alertes-deploiement-native
Expand Down
Loading