From 7fb33ce5f2bd28b4c1c63667ca9e9c5d4d63b0ed Mon Sep 17 00:00:00 2001 From: Eric Willhoit Date: Wed, 8 Jan 2025 15:13:42 -0600 Subject: [PATCH 1/2] chore: update actions --- .github/workflows/failureNotifications.yml | 43 ++++++++++++++++++++++ .github/workflows/test.yml | 8 +++- .github/workflows/unitTestsLinux.yml | 31 ---------------- .github/workflows/unitTestsWindows.yml | 34 ----------------- 4 files changed, 49 insertions(+), 67 deletions(-) create mode 100644 .github/workflows/failureNotifications.yml delete mode 100644 .github/workflows/unitTestsLinux.yml delete mode 100644 .github/workflows/unitTestsWindows.yml diff --git a/.github/workflows/failureNotifications.yml b/.github/workflows/failureNotifications.yml new file mode 100644 index 00000000..5ffc7747 --- /dev/null +++ b/.github/workflows/failureNotifications.yml @@ -0,0 +1,43 @@ +name: failureNotifications +on: + workflow_run: + workflows: + - publish + - create-github-release + types: + - completed +jobs: + failure-notify: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'failure' }} + steps: + - name: Announce Failure + id: slack + uses: slackapi/slack-github-action@v1.26.0 + env: + # for non-CLI-team-owned plugins, you can send this anywhere you like + SLACK_WEBHOOK_URL: ${{ secrets.CLI_ALERTS_SLACK_WEBHOOK }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + with: + # Payload can be visually tested here: https://app.slack.com/block-kit-builder/T01GST6QY0G#%7B%22blocks%22:%5B%5D%7D + # Only copy over the "blocks" array to the Block Kit Builder + payload: | + { + "text": "Workflow \"${{ github.event.workflow_run.name }}\" failed in ${{ github.event.workflow_run.repository.name }}", + "blocks": [ + { + "type": "header", + "text": { + "type": "plain_text", + "text": ":bh-alert: Workflow \"${{ github.event.workflow_run.name }}\" failed in ${{ github.event.workflow_run.repository.name }} :bh-alert:" + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*Repo:* ${{ github.event.workflow_run.repository.html_url }}\n*Workflow name:* `${{ github.event.workflow_run.name }}`\n*Job url:* ${{ github.event.workflow_run.html_url }}" + } + } + ] + } diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4ec28f3d..af95a6f6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,10 +6,14 @@ on: workflow_dispatch: jobs: + yarn-lockfile-check: + uses: salesforcecli/github-workflows/.github/workflows/lockFileCheck.yml@main linux-unit-tests: - uses: ./.github/workflows/unitTestsLinux.yml + needs: yarn-lockfile-check + uses: salesforcecli/github-workflows/.github/workflows/unitTestsLinux.yml@main windows-unit-tests: - uses: ./.github/workflows/unitTestsWindows.yml + needs: yarn-lockfile-check + uses: salesforcecli/github-workflows/.github/workflows/unitTestsWindows.yml@main test-bundle: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/unitTestsLinux.yml b/.github/workflows/unitTestsLinux.yml deleted file mode 100644 index 823691d9..00000000 --- a/.github/workflows/unitTestsLinux.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Linux Tests - -on: - workflow_call: - -jobs: - linux-unit-tests: - strategy: - matrix: - node_version: [lts/-1, lts/*] - fail-fast: false - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node_version }} - cache: yarn - - name: Cache node modules - id: cache-nodemodules - uses: actions/cache@v3 - env: - cache-name: cache-node-modules - with: - path: '**/node_modules' - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} - - - run: yarn install --network-timeout 600000 - if: ${{ steps.cache-nodemodules.outputs.cache-hit != 'true' }} - - run: yarn build - - run: yarn test diff --git a/.github/workflows/unitTestsWindows.yml b/.github/workflows/unitTestsWindows.yml deleted file mode 100644 index fc53f0a9..00000000 --- a/.github/workflows/unitTestsWindows.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Windows Tests - -on: - workflow_call: - -jobs: - windows-unit-tests: - strategy: - matrix: - node_version: [lts/-1, lts/*] - fail-fast: false - runs-on: windows-latest - steps: - - name: Git config check for carriage returns - run: git config --global core.autocrlf false - shell: bash - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node_version }} - cache: yarn - - name: Cache node modules - id: cache-nodemodules - uses: actions/cache@v3 - env: - cache-name: cache-node-modules - with: - path: '**/node_modules' - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} - - - run: yarn install --network-timeout 600000 - if: ${{ steps.cache-nodemodules.outputs.cache-hit != 'true' }} - - run: yarn build - - run: yarn test From 18f65b39fa7b3470b4759e78ba38b907036f4c87 Mon Sep 17 00:00:00 2001 From: Eric Willhoit Date: Wed, 8 Jan 2025 15:16:03 -0600 Subject: [PATCH 2/2] chore: failure url --- .github/workflows/failureNotifications.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/failureNotifications.yml b/.github/workflows/failureNotifications.yml index 5ffc7747..949f555d 100644 --- a/.github/workflows/failureNotifications.yml +++ b/.github/workflows/failureNotifications.yml @@ -16,7 +16,7 @@ jobs: uses: slackapi/slack-github-action@v1.26.0 env: # for non-CLI-team-owned plugins, you can send this anywhere you like - SLACK_WEBHOOK_URL: ${{ secrets.CLI_ALERTS_SLACK_WEBHOOK }} + SLACK_WEBHOOK_URL: ${{ secrets.IDEE_RELEASE_ALERT_SLACK_WEBHOOK }} SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK with: # Payload can be visually tested here: https://app.slack.com/block-kit-builder/T01GST6QY0G#%7B%22blocks%22:%5B%5D%7D