Skip to content

Commit

Permalink
GH action
Browse files Browse the repository at this point in the history
  • Loading branch information
alpe committed Apr 24, 2024
1 parent 58fdc04 commit 883d3ba
Showing 1 changed file with 58 additions and 47 deletions.
105 changes: 58 additions & 47 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@ name: Sims
# Sims workflow runs multiple types of simulations (nondeterminism, import-export, after-import, multi-seed-short)
# This workflow will run on all Pull Requests, if a .go, .mod or .sum file have been changed
on:
schedule:
- cron: "0 */2 * * *"
release:
types: [published]
pull_request: # Alex: DO NOT merge
branches:
- main
- release/**
paths:
- "**/*.go"
- "go.mod"
- "go.sum"
push:
branches:
- main
paths:
- "**/*.go"
- "go.mod"
- "go.sum"

concurrency:
group: ci-${{ github.ref }}-sims
Expand Down Expand Up @@ -84,47 +95,47 @@ jobs:
run: |
make test-sim-multi-seed-short
sims-notify-success:
needs:
[test-sim-multi-seed-short, test-sim-after-import, test-sim-import-export]
runs-on: ubuntu-latest
if: ${{ success() }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Get previous workflow status
uses: ./.github/actions/last-workflow-status
id: last_status
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Notify Slack on success
if: ${{ steps.last_status.outputs.last_status == 'failure' }}
uses: rtCamp/action-slack-notify@v2.3.0
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: sdk-sims
SLACK_USERNAME: Sim Tests
SLACK_ICON_EMOJI: ":white_check_mark:"
SLACK_COLOR: good
SLACK_MESSAGE: Sims are passing
SLACK_FOOTER: ""
# sims-notify-success:
# needs:
# [test-sim-multi-seed-short, test-sim-after-import, test-sim-import-export]
# runs-on: ubuntu-latest
# if: ${{ success() }}
# steps:
# - name: Check out repository
# uses: actions/checkout@v4
# - name: Get previous workflow status
# uses: ./.github/actions/last-workflow-status
# id: last_status
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Notify Slack on success
# if: ${{ steps.last_status.outputs.last_status == 'failure' }}
# uses: rtCamp/action-slack-notify@v2.3.0
# env:
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
# SLACK_CHANNEL: sdk-sims
# SLACK_USERNAME: Sim Tests
# SLACK_ICON_EMOJI: ":white_check_mark:"
# SLACK_COLOR: good
# SLACK_MESSAGE: Sims are passing
# SLACK_FOOTER: ""

sims-notify-failure:
permissions:
contents: none
needs:
[test-sim-multi-seed-short, test-sim-after-import, test-sim-import-export]
runs-on: ubuntu-latest
if: ${{ failure() }}
steps:
- name: Notify Slack on failure
uses: rtCamp/action-slack-notify@v2.3.0
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: sdk-sims
SLACK_USERNAME: Sim Tests
SLACK_ICON_EMOJI: ":skull:"
SLACK_COLOR: danger
SLACK_MESSAGE: Sims are failing
SLACK_FOOTER: ""
# sims-notify-failure:
# permissions:
# contents: none
# needs:
# [test-sim-multi-seed-short, test-sim-after-import, test-sim-import-export]
# runs-on: ubuntu-latest
# if: ${{ failure() }}
# steps:
# - name: Notify Slack on failure
# uses: rtCamp/action-slack-notify@v2.3.0
# env:
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
# SLACK_CHANNEL: sdk-sims
# SLACK_USERNAME: Sim Tests
# SLACK_ICON_EMOJI: ":skull:"
# SLACK_COLOR: danger
# SLACK_MESSAGE: Sims are failing
# SLACK_FOOTER: ""

0 comments on commit 883d3ba

Please sign in to comment.