From 6798731545f0dd0d8e10ac34ac9a7fad9564aa03 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 12 Dec 2022 10:24:04 -0800 Subject: [PATCH] Merge CI jobs into one workflow (#935) --- .github/workflows/ci.yaml | 99 +++++++++++++++++++++++++++++++++++++ .github/workflows/docs.yaml | 42 ---------------- .github/workflows/lint.yaml | 46 ----------------- .github/workflows/test.yaml | 41 --------------- 4 files changed, 99 insertions(+), 129 deletions(-) create mode 100644 .github/workflows/ci.yaml delete mode 100644 .github/workflows/docs.yaml delete mode 100644 .github/workflows/lint.yaml delete mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000000..5af6742ba0 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,99 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + branches: + - master + +defaults: + run: + shell: bash + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3.0.0 + + - uses: peaceiris/actions-mdbook@v1 + with: + mdbook-version: latest + + - name: Install mdbook-linkcheck + run: | + mkdir -p mdbook-linkcheck + cd mdbook-linkcheck + wget https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/latest/download/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip + unzip mdbook-linkcheck.x86_64-unknown-linux-gnu.zip + chmod +x mdbook-linkcheck + pwd >> $GITHUB_PATH + + - run: mdbook build docs + + - name: Deploy Pages + uses: peaceiris/actions-gh-pages@v3 + if: github.ref == 'refs/heads/master' + with: + github_token: ${{secrets.GITHUB_TOKEN}} + publish_branch: gh-pages + publish_dir: docs/build/html + lint: + runs-on: ubuntu-latest + + env: + RUSTFLAGS: --deny warnings + + steps: + - uses: actions/checkout@v2 + + - name: Install Rust Toolchain Components + uses: actions-rs/toolchain@v1 + with: + components: clippy, rustfmt + override: true + toolchain: stable + + - uses: Swatinem/rust-cache@v1 + + - name: Check Lockfile + run: cargo update --locked --package ord + + - name: Clippy + run: cargo clippy --all --all-targets + + - name: Format + run: cargo fmt --all -- --check + + - name: Check for Forbidden Words + run: | + sudo apt-get install ripgrep + ./bin/forbid + test: + strategy: + matrix: + os: + - macos-latest + - ubuntu-latest + - windows-latest + + runs-on: ${{matrix.os}} + + env: + RUSTFLAGS: --deny warnings + + steps: + - uses: actions/checkout@v2 + + - name: Install Rust Toolchain Components + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + + - uses: Swatinem/rust-cache@v1 + + - name: Test + run: cargo test --all diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml deleted file mode 100644 index 589349c0e2..0000000000 --- a/.github/workflows/docs.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: Docs - -on: - pull_request: - branches: - - master - push: - branches: - - master - -defaults: - run: - shell: bash - -jobs: - docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.0.0 - - - uses: peaceiris/actions-mdbook@v1 - with: - mdbook-version: latest - - - name: Install mdbook-linkcheck - run: | - mkdir -p mdbook-linkcheck - cd mdbook-linkcheck - wget https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/latest/download/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip - unzip mdbook-linkcheck.x86_64-unknown-linux-gnu.zip - chmod +x mdbook-linkcheck - pwd >> $GITHUB_PATH - - - run: mdbook build docs - - - name: Deploy Pages - uses: peaceiris/actions-gh-pages@v3 - if: github.ref == 'refs/heads/master' - with: - github_token: ${{secrets.GITHUB_TOKEN}} - publish_branch: gh-pages - publish_dir: docs/build/html diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml deleted file mode 100644 index f70714bec3..0000000000 --- a/.github/workflows/lint.yaml +++ /dev/null @@ -1,46 +0,0 @@ -name: Lint - -on: - push: - branches: - - master - pull_request: - branches: - - master - -defaults: - run: - shell: bash - -jobs: - lint: - runs-on: ubuntu-latest - - env: - RUSTFLAGS: --deny warnings - - steps: - - uses: actions/checkout@v2 - - - name: Install Rust Toolchain Components - uses: actions-rs/toolchain@v1 - with: - components: clippy, rustfmt - override: true - toolchain: stable - - - uses: Swatinem/rust-cache@v1 - - - name: Check Lockfile - run: cargo update --locked --package ord - - - name: Clippy - run: cargo clippy --all --all-targets - - - name: Format - run: cargo fmt --all -- --check - - - name: Check for Forbidden Words - run: | - sudo apt-get install ripgrep - ./bin/forbid diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index 7112f67aef..0000000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -1,41 +0,0 @@ -name: Test - -on: - push: - branches: - - master - pull_request: - branches: - - master - -defaults: - run: - shell: bash - -jobs: - test: - strategy: - matrix: - os: - - macos-latest - - ubuntu-latest - - windows-latest - - runs-on: ${{matrix.os}} - - env: - RUSTFLAGS: --deny warnings - - steps: - - uses: actions/checkout@v2 - - - name: Install Rust Toolchain Components - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - - uses: Swatinem/rust-cache@v1 - - - name: Test - run: cargo test --all