fix: move checkout step to the beginning of each job in build workflow #390
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: Build OBS Service Cargo | |
| on: | |
| push: | |
| paths: | |
| - '**.rs' | |
| - '**/github/**.yaml' | |
| - '**/github/**.yml' | |
| - '**/Cargo.toml' | |
| - '**/Cargo.lock' | |
| - '!**.md' | |
| pull_request: | |
| paths: | |
| - '**.rs' | |
| - '**/Cargo.toml' | |
| - '**/Cargo.lock' | |
| - '!**.md' | |
| env: | |
| CARGO_TERM_COLOR: always | |
| TOOLCHAIN_VERSION: stable | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| container: opensuse/leap | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install tar, gzip, dependencies and Rust | |
| run: | | |
| zypper --non-interactive -vvv in tar gzip libzstd-devel rustup openssl-devel | |
| # Seems to be a rustup command inconsistency | |
| rustup show | |
| - name: Build | |
| run: | | |
| cargo update | |
| cargo build --release --all-features | |
| style: | |
| runs-on: ubuntu-latest | |
| container: opensuse/leap | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install tar, gzip, dependencies and Rust | |
| run: | | |
| zypper --non-interactive -vvv in tar gzip libzstd-devel rustup openssl-devel | |
| # Seems to be a rustup command inconsistency | |
| rustup show | |
| - name: Check formatting | |
| run: | | |
| cargo fmt -- --check || true | |
| - name: Check clippy | |
| run: | | |
| cargo clippy | |
| cargo clippy --tests | |
| tests: | |
| runs-on: ubuntu-latest | |
| container: opensuse/leap | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install tar, gzip, dependencies and Rust | |
| run: | | |
| zypper --non-interactive -vvv in tar gzip libzstd-devel rustup openssl-devel | |
| # Seems to be a rustup command inconsistency | |
| rustup show | |
| - name: Install cargo-vendor-filterer | |
| run: | | |
| cargo install cargo-vendor-filterer | |
| - name: Run sample projects to test | |
| run: | | |
| export PATH="${PATH}:${HOME}/.cargo/bin" | |
| echo "${PATH}" | |
| cargo test --release -- --test-threads=1 | |
| cargo test --release -- --test-threads=1 --ignored |