-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add slack notification for E2E failures for linux mac and windows
- Loading branch information
Showing
3 changed files
with
168 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,89 +31,120 @@ jobs: | |
TAGS: ${{ github.event.inputs.tags || 'all' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/[email protected] | ||
with: | ||
ruby-version: 3.1.2 | ||
bundler-cache: true | ||
|
||
- name: Install dependencies | ||
run: bundle install | ||
|
||
- name: Prepare MacOS | ||
run: brew install screen | ||
|
||
- name: 💾 GH Cache node db | ||
id: cache-node | ||
uses: actions/cache@v3 | ||
with: | ||
path: test/e2e/state/node_db/preprod | ||
key: node-db-e2e-macos-preprod | ||
|
||
- name: 💾 Cache wallet db | ||
id: cache-wallet | ||
uses: actions/cache@v3 | ||
with: | ||
path: test/e2e/state/wallet_db/preprod | ||
key: wallet-db-e2-macos-preprod | ||
|
||
- name: Fetch preprod snapshot | ||
if: steps.cache-node.outputs.cache-hit != 'true' | ||
- name: Fail on purpose | ||
run: exit 0 | ||
# - uses: actions/checkout@v3 | ||
|
||
# - name: Set up Ruby | ||
# uses: ruby/[email protected] | ||
# with: | ||
# ruby-version: 3.1.2 | ||
# bundler-cache: true | ||
|
||
# - name: Install dependencies | ||
# run: bundle install | ||
|
||
# - name: Prepare MacOS | ||
# run: brew install screen | ||
|
||
# - name: 💾 GH Cache node db | ||
# id: cache-node | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: test/e2e/state/node_db/preprod | ||
# key: node-db-e2e-macos-preprod | ||
|
||
# - name: 💾 Cache wallet db | ||
# id: cache-wallet | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: test/e2e/state/wallet_db/preprod | ||
# key: wallet-db-e2-macos-preprod | ||
|
||
# - name: Fetch preprod snapshot | ||
# if: steps.cache-node.outputs.cache-hit != 'true' | ||
# run: | | ||
# mkdir state | ||
# cd state | ||
# mkdir node_db | ||
# cd node_db | ||
# mkdir preprod | ||
# cd preprod | ||
# curl -s https://downloads.csnapshots.io/snapshots/testnet/testnet-db-snapshot.json \ | ||
# | jq -r .[].file_name > snapshot.json | ||
# curl -o - \ | ||
# https://downloads.csnapshots.io/snapshots/testnet/$(cat snapshot.json) \ | ||
# | lz4 -c -d - | tar -x -C . | ||
# mv db/* . | ||
|
||
|
||
# - name: ⚙️ Setup (get latest bins and configs and decode fixtures) | ||
# run: rake setup[preprod,$BRANCH] | ||
|
||
# - name: 🔍 Display versions | ||
# run: rake display_versions | ||
|
||
# - name: 🚀 Start node and wallet | ||
# run: rake start_node_and_wallet[preprod] | ||
|
||
# - name: ⏳ Wait until node is synced | ||
# run: rake wait_until_node_synced | ||
|
||
# - name: 🧪 Run all tests | ||
# run: rake spec SPEC_OPTS="-t $TAGS" | ||
|
||
# - name: 🏁 Stop node and wallet | ||
# run: rake stop_node_and_wallet[preprod] | ||
|
||
# - name: 💾 GH Save Cache of node db | ||
# if: always() | ||
# uses: actions/cache/save@v3 | ||
# with: | ||
# path: test/e2e/state/node_db/preprod | ||
# key: node-db-e2e-macos-preprod | ||
|
||
# - name: 💾 GH Save Cache of wallet db | ||
# if: always() | ||
# uses: actions/cache/save@v3 | ||
# with: | ||
# path: test/e2e/state/wallet_db/preprod | ||
# key: wallet-db-e2e-macos-preprod | ||
|
||
# - name: 📎 Upload state | ||
# uses: actions/upload-artifact@v3 | ||
# if: always() | ||
# with: | ||
# name: macos-state | ||
# path: | | ||
# test/e2e/state/logs | ||
# test/e2e/state/configs | ||
# test/e2e/state/wallet_db | ||
report: | ||
needs: test | ||
if: always() | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: print result | ||
run: | | ||
mkdir state | ||
cd state | ||
mkdir node_db | ||
cd node_db | ||
mkdir preprod | ||
cd preprod | ||
curl -s https://downloads.csnapshots.io/snapshots/testnet/testnet-db-snapshot.json \ | ||
| jq -r .[].file_name > snapshot.json | ||
curl -o - \ | ||
https://downloads.csnapshots.io/snapshots/testnet/$(cat snapshot.json) \ | ||
| lz4 -c -d - | tar -x -C . | ||
mv db/* . | ||
- name: ⚙️ Setup (get latest bins and configs and decode fixtures) | ||
run: rake setup[preprod,$BRANCH] | ||
|
||
- name: 🔍 Display versions | ||
run: rake display_versions | ||
|
||
- name: 🚀 Start node and wallet | ||
run: rake start_node_and_wallet[preprod] | ||
|
||
- name: ⏳ Wait until node is synced | ||
run: rake wait_until_node_synced | ||
|
||
- name: 🧪 Run all tests | ||
run: rake spec SPEC_OPTS="-t $TAGS" | ||
|
||
- name: 🏁 Stop node and wallet | ||
run: rake stop_node_and_wallet[preprod] | ||
|
||
- name: 💾 GH Save Cache of node db | ||
if: always() | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: test/e2e/state/node_db/preprod | ||
key: node-db-e2e-macos-preprod | ||
|
||
- name: 💾 GH Save Cache of wallet db | ||
if: always() | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: test/e2e/state/wallet_db/preprod | ||
key: wallet-db-e2e-macos-preprod | ||
|
||
- name: 📎 Upload state | ||
uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: macos-state | ||
path: | | ||
test/e2e/state/logs | ||
test/e2e/state/configs | ||
test/e2e/state/wallet_db | ||
echo ${{ needs.test.result }} | ||
- name: Slack Notification on failure | ||
if: needs.test.result != 'success' | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
SLACK_ICON_EMOJI: ':poop:' | ||
SLACK_USERNAME: 'GitHub Action' | ||
SLACK_MESSAGE: | | ||
*Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
SLACK_COLOR: '#FF0000' | ||
|
||
- name: Slack Notification on success | ||
if: needs.test.result == 'success' | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
SLACK_ICON_EMOJI: ':rocket:' | ||
SLACK_USERNAME: 'GitHub Action' | ||
SLACK_MESSAGE: | | ||
*Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
SLACK_COLOR: '#00FF00' |
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