Skip to content

upgrade slack orb

upgrade slack orb #10

name: sonatype-nexus-community/cargo-pants/build_and_release
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
container:
image: rust:1.69
env:
SLACK_ACCESS_TOKEN:
SLACK_DEFAULT_CHANNEL:
steps:
- uses: actions/checkout@v3
- name: Version information
run: rustc --version; cargo --version; rustup --version
- name: Calculate dependencies
run: cargo generate-lockfile
# - name: restore_cache
# uses: actions/cache@v3
# with:
# key: cargo-pants-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
# path: |-
# ~/.cargo
# ./target
- name: Install rustfmt
run: rustup component add rustfmt
- name: Check formatting
run: cargo fmt -- --check
- name: Build all targets
run: cargo build --all --all-targets
- name: Run all tests
run: cargo test --all
- name: Dogfood with locally built Cargo Pants
run: "./target/debug/cargo-pants pants --ignore-file .pants-ignore"
- name: Install Cargo Pants as Cargo Subcommand
run: cargo install cargo-pants --force
- name: Dogfood Cargo Pants
run: cargo pants
- uses: "./.github/actions/slack_notify"
continue-on-error: true
if: failure()
with:
slack_webhook: "${{ secrets.SLACK_WEBHOOK }}"
slack_channel: "${{ env.SLACK_DEFAULT_CHANNEL }}"
branch_pattern: main
release:
if: ${{ false }} # disable for now
# if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
container:
image: rust:1.69
needs:
- build
env:
CARGO_REGISTRY_TOKEN:
GITHUB_EMAIL:
GITHUB_USERNAME:
SLACK_ACCESS_TOKEN:
SLACK_DEFAULT_CHANNEL:
steps:
# Ensure parameter if_key_exists is set correctly
- name: Install SSH key
uses: shimataro/ssh-key-action@v2.5.0
with:
key: "${{ secrets.CIRCLE_CI_SSH_KEY }}"
name: circle_ci_id_rsa
known_hosts: "${{ secrets.CIRCLE_CI_KNOWN_HOSTS }}"
if_key_exists: fail
- uses: actions/checkout@v3
- name: Run publish
run: ".circleci/ci-publish.sh"
- uses: "./.github/actions/slack_notify"
continue-on-error: true
if: failure()
with:
slack_webhook: "${{ secrets.SLACK_WEBHOOK }}"
slack_channel: "${{ env.SLACK_DEFAULT_CHANNEL }}"
branch_pattern: main