Merge pull request #1 from benthecarman/ignore #61
This file contains hidden or 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
name: Continuous Integration Checks | |
on: | |
push: | |
branches-ignore: | |
- master | |
pull_request: | |
branches-ignore: | |
- master | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ ubuntu-latest, windows-latest, macos-latest ] | |
toolchain: [ stable, beta, 1.63.0 ] # 1.63.0 is the MSRV | |
exclude: | |
- platform: windows-latest | |
toolchain: 1.63.0 | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Install Rust ${{ matrix.toolchain }} toolchain | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ matrix.toolchain }} | |
rustup override set ${{ matrix.toolchain }} | |
- name: shellcheck the CI and `contrib` scripts | |
if: "matrix.platform == 'ubuntu-latest'" | |
run: | | |
sudo apt-get -y install shellcheck | |
shellcheck ci/*.sh -aP ci | |
- name: Set RUSTFLAGS to deny warnings | |
if: "matrix.toolchain == '1.63.0'" | |
run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV" | |
- name: Run CI script | |
shell: bash # Default on Winblows is powershell | |
run: ./ci/ci-tests.sh | |
linting: | |
runs-on: ubuntu-latest | |
env: | |
TOOLCHAIN: 1.63.0 | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }} | |
rustup override set ${{ env.TOOLCHAIN }} | |
- name: Install clippy | |
run: | | |
rustup component add clippy | |
- name: Run default clippy linting | |
run: | | |
./ci/check-lint.sh | |
rustfmt: | |
runs-on: ubuntu-latest | |
env: | |
TOOLCHAIN: 1.63.0 | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }} | |
rustup override set ${{ env.TOOLCHAIN }} | |
- name: Install rustfmt | |
run: | | |
rustup component add rustfmt | |
- name: Run rustfmt checks | |
run: ci/rustfmt.sh | |
fuzz: | |
runs-on: ubuntu-latest | |
env: | |
TOOLCHAIN: 1.63 | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }} | |
rustup override set ${{ env.TOOLCHAIN }} | |
- name: Install dependencies for honggfuzz | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install build-essential binutils-dev libunwind-dev | |
- name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }} | |
run: | | |
cd fuzz | |
RUSTFLAGS="--cfg=fuzzing --cfg=secp256k1_fuzz --cfg=hashes_fuzz" cargo test --verbose --color always | |
cargo clean | |
- name: Run fuzzers | |
run: cd fuzz && ./ci-fuzz.sh && cd .. |