Skip to content

Commit

Permalink
Use composite actions (#1032)
Browse files Browse the repository at this point in the history
utilize notify slack and lint toml composite actions in ci.yml

test run: https://github.com/FuelLabs/fuel-core/actions/runs/4214220082

FuelLabs/.github#2 needs to be merged first,
since I changed the composite actions tags to point to master after
running the test
  • Loading branch information
tirkesi authored Feb 21, 2023
1 parent 0b2f445 commit 31b52ba
Showing 1 changed file with 22 additions and 81 deletions.
103 changes: 22 additions & 81 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Install Cargo.toml linter
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-sort
version: '1.0.9'
- name: Run Cargo.toml sort check
run: cargo sort -w --check
- name: Notify if Job Fails
uses: ravsamhq/notify-slack-action@v2
- uses: FuelLabs/.github/.github/actions/lint-toml-template@master
- uses: FuelLabs/.github/.github/actions/slack-notify-template@master
if: always() && github.ref == 'refs/heads/master'
with:
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: '{workflow} has {status_message}'
message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>'
footer: ''
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NOTIFY_BUILD }}
github_token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook: ${{ secrets.SLACK_WEBHOOK_NOTIFY_BUILD }}

prevent-openssl:
runs-on: ubuntu-latest
Expand All @@ -68,19 +52,11 @@ jobs:
# ensure openssl hasn't crept into the dep tree
- name: Check if openssl is included
run: ./.github/workflows/scripts/verify_openssl.sh

- name: Notify if Job Fails
uses: ravsamhq/notify-slack-action@v2
- uses: FuelLabs/.github/.github/actions/slack-notify-template@master
if: always() && github.ref == 'refs/heads/master'
with:
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: '{workflow} has {status_message}'
message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>'
footer: ''
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NOTIFY_BUILD }}
github_token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook: ${{ secrets.SLACK_WEBHOOK_NOTIFY_BUILD }}

cargo-verifications:
needs:
Expand Down Expand Up @@ -127,18 +103,12 @@ jobs:
cache-on-failure: "true"
- name: ${{ matrix.command }} ${{ matrix.args }}
run: cargo ${{ matrix.command }} ${{ matrix.args }}
- name: Notify if Job Fails
uses: ravsamhq/notify-slack-action@v2
- uses: FuelLabs/.github/.github/actions/slack-notify-template@master
if: always() && github.ref == 'refs/heads/master'
with:
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: '{workflow} has {status_message}'
message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>'
footer: ''
notify_when: 'failure'
github_token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook: ${{ secrets.SLACK_WEBHOOK_NOTIFY_BUILD }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NOTIFY_BUILD }}
RUSTFLAGS: -D warnings

publish-crates-check:
Expand Down Expand Up @@ -214,18 +184,11 @@ jobs:
publish-delay: 60000
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

- name: Notify if Job Fails
uses: ravsamhq/notify-slack-action@v2
- uses: FuelLabs/.github/.github/actions/slack-notify-template@master
if: always()
with:
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: '{workflow} has {status_message}'
message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>'
footer: ''
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NOTIFY_BUILD }}
github_token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook: ${{ secrets.SLACK_WEBHOOK_NOTIFY_BUILD }}

publish-docker-image:
needs:
Expand Down Expand Up @@ -273,18 +236,11 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Notify if Job Fails
uses: ravsamhq/notify-slack-action@v2
- uses: FuelLabs/.github/.github/actions/slack-notify-template@master
if: always() && (github.ref == 'refs/heads/master' || github.ref_type == 'tag')
with:
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: '{workflow} has {status_message}'
message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>'
footer: ''
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NOTIFY_BUILD }}
github_token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook: ${{ secrets.SLACK_WEBHOOK_NOTIFY_BUILD }}

publish-e2e-client-docker-image:
needs:
Expand Down Expand Up @@ -332,18 +288,11 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Notify if Job Fails
uses: ravsamhq/notify-slack-action@v2
- uses: FuelLabs/.github/.github/actions/slack-notify-template@master
if: always() && (github.ref == 'refs/heads/master' || github.ref_type == 'tag')
with:
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: '{workflow} has {status_message}'
message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>'
footer: ''
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NOTIFY_BUILD }}
github_token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook: ${{ secrets.SLACK_WEBHOOK_NOTIFY_BUILD }}

publish-fuel-core-binary:
name: Release fuel-core binaries
Expand Down Expand Up @@ -474,19 +423,11 @@ jobs:
asset_name: ${{ env.ZIP_FILE_NAME }}
asset_content_type: application/gzip

- name: Notify if Job Fails
uses: ravsamhq/notify-slack-action@v2
# need to find a work-around to be able to run this action on mac
- uses: FuelLabs/.github/.github/actions/slack-notify-template@master
if: always() && (github.ref == 'refs/heads/master' || github.ref_type == 'tag') && matrix.job.os != 'macos-latest'
with:
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: '{workflow} has {status_message}'
message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>'
footer: ''
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NOTIFY_BUILD }}
github_token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook: ${{ secrets.SLACK_WEBHOOK_NOTIFY_BUILD }}

# Deploy Fuel Core Ephemeral Developer Environment
deploy-eph-env:
Expand Down

0 comments on commit 31b52ba

Please sign in to comment.