From b230a1deadfa0680c3ceb601409e2e7d4a8e80e2 Mon Sep 17 00:00:00 2001 From: Lukasz Woznicki Date: Wed, 30 Aug 2023 16:29:18 +0100 Subject: [PATCH] Remove redundant CI steps, add missing build and build release steps --- .github/workflows/checks.yaml | 3 +- .github/workflows/ci.yaml | 60 ----------------------------------- .github/workflows/tests.yaml | 44 +++++++++++++++++++++++-- 3 files changed, 43 insertions(+), 64 deletions(-) delete mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index ebfe4cf3..641f2968 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -4,8 +4,7 @@ env: CARGO_TERM_COLOR: always on: - push: - branches: [ main ] # this should be blocked entirely! + workflow_dispatch: pull_request: jobs: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index d7e03daa..00000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: ci - -on: - push: - branches: [ main ] - pull_request: - -jobs: - test: - name: Rust ${{matrix.rust}} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - rust: [stable, beta] - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{matrix.rust}} - components: rustfmt - - run: | - cargo test --lib --bins --examples --benches - - run: | - # We expect doc example to fail without Falcon Credentials - cargo test --doc | grep 'Missing FALCON_CLIENT_ID environment variable.' - - name: rustfmt - run: | - cargo fmt - if [[ -n $(git status -s) ]] ; then - echo "Running rustfmt leaves codebase in modified state." - echo "Please run rustfmt or cargo fmt on your PR" - git status -s - git diff - exit 1 - fi - - nightly: - name: Rust nightly - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@nightly - with: - components: rust-src - - run: | - cargo test --lib --bins --examples --benches - - run: | - # We expect doc example to fail without Falcon Credentials - cargo test --doc | grep 'Missing FALCON_CLIENT_ID environment variable.' - - run: cargo update -Z minimal-versions - - run: cargo build - - outdated: - name: Outdated - runs-on: ubuntu-latest - if: github.event_name != 'pull_request' - steps: - - uses: actions/checkout@v3 - - run: cargo outdated --exit-code 1 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 788308f2..6aad6d7a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -9,9 +9,31 @@ on: pull_request: jobs: - required: + build: runs-on: ubuntu-latest - name: ubuntu / ${{ matrix.toolchain }} + name: Build Ubuntu / ${{ matrix.toolchain }} + strategy: + matrix: + toolchain: [stable, beta] + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install ${{ matrix.toolchain }} + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.toolchain }} + - name: cargo generate-lockfile + if: hashFiles('Cargo.lock') == '' + run: cargo generate-lockfile + - name: cargo build + run: cargo build + - name: cargo build release + run: cargo build --release + + test: + runs-on: ubuntu-latest + name: Test Ubuntu / ${{ matrix.toolchain }} strategy: matrix: toolchain: [stable, beta] @@ -32,6 +54,20 @@ jobs: - name: cargo test --doc run: cargo test --locked --all-features --doc | grep 'Missing FALCON_CLIENT_ID environment variable.' + nightly: + name: Rust nightly + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@nightly + with: + components: rust-src + - run: | + cargo test --lib --bins --examples --benches + - run: | + # We expect doc example to fail without Falcon Credentials + cargo test --doc | grep 'Missing FALCON_CLIENT_ID environment variable.' + minimal: runs-on: ubuntu-latest name: ubuntu / stable / minimal-versions @@ -70,5 +106,9 @@ jobs: - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' run: cargo generate-lockfile + - name: cargo build + run: cargo build + - name: cargo build release + run: cargo build --release - name: cargo test run: cargo test --locked --all-features --all-targets