From 1d0405ed5b5cd76f4fe79e73fb30f4d4dce1d441 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Wed, 19 Jul 2023 23:23:05 +0300 Subject: [PATCH] ci: add env vars --- .ci/check.yml | 10 --------- .gitea/workflows/builds.yaml | 38 +++++++++++++++++-------------- .gitea/workflows/test.yaml | 43 +++++++++++++++++++++--------------- 3 files changed, 46 insertions(+), 45 deletions(-) delete mode 100644 .ci/check.yml diff --git a/.ci/check.yml b/.ci/check.yml deleted file mode 100644 index 59998802..00000000 --- a/.ci/check.yml +++ /dev/null @@ -1,10 +0,0 @@ -matrix: - RUST: [stable] - -pipeline: - test: - image: rust - environment: [CARGO_TERM_COLOR=always] - commands: - - rustup default $RUST - - make check diff --git a/.gitea/workflows/builds.yaml b/.gitea/workflows/builds.yaml index 866906e9..3d92edeb 100644 --- a/.gitea/workflows/builds.yaml +++ b/.gitea/workflows/builds.yaml @@ -1,8 +1,12 @@ name: Build release binary env: - RUST_BACKTRACE: 1 + CARGO_INCREMENTAL: 0 + CARGO_NET_RETRY: 10 CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse + RUSTFLAGS: "-D warnings -W unreachable-pub -W rust-2021-compatibility" + RUSTUP_MAX_RETRIES: 10 + RUST_BACKTRACE: short on: workflow_dispatch: @@ -31,14 +35,14 @@ jobs: run: | apt-get update apt-get install -y libdbus-1-dev pkg-config mandoc libssl-dev - - id: cache-rustup - name: Cache Rust toolchain - uses: https://github.com/actions/cache@v3 - with: - path: ~/.rustup - key: toolchain-${{ matrix.os }}-${{ matrix.rust }} - - if: ${{ steps.cache-rustup.outputs.cache-hit != 'true' }} - name: Install Rust ${{ matrix.rust }} + #- id: cache-rustup + # name: Cache Rust toolchain + # uses: https://github.com/actions/cache@v3 + # with: + # path: ~/.rustup + # key: toolchain-${{ matrix.os }}-${{ matrix.rust }} + #- if: ${{ steps.cache-rustup.outputs.cache-hit != 'true' }} + - name: Install Rust ${{ matrix.rust }} uses: https://github.com/actions-rs/toolchain@v1 with: profile: minimal @@ -52,14 +56,14 @@ jobs: # around a bug in the 'cache' action that causes directories outside of # the workspace dir to be saved/restored incorrectly. run: echo "CARGO_HOME=$(pwd)/.cargo_home" >> $GITHUB_ENV - - id: cache-cargo - name: Cache cargo configuration and installations - uses: https://github.com/actions/cache@v3 - with: - path: ${{ env.CARGO_HOME }} - key: cargo-${{ matrix.os }}-${{ matrix.rust }} - - if: ${{ steps.cache-cargo.outputs.cache-hit != 'true' }} && matrix.target - name: Setup Rust target + #- id: cache-cargo + # name: Cache cargo configuration and installations + # uses: https://github.com/actions/cache@v3 + # with: + # path: ${{ env.CARGO_HOME }} + # key: cargo-${{ matrix.os }}-${{ matrix.rust }} + #- if: ${{ steps.cache-cargo.outputs.cache-hit != 'true' }} && matrix.target + - name: Setup Rust target run: | mkdir -p "${{ env.CARGO_HOME }}" cat << EOF > "${{ env.CARGO_HOME }}"/config.toml diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml index 0a023f0c..8fe5fd2d 100644 --- a/.gitea/workflows/test.yaml +++ b/.gitea/workflows/test.yaml @@ -1,8 +1,12 @@ name: Tests env: - RUST_BACKTRACE: 1 + CARGO_INCREMENTAL: 0 + CARGO_NET_RETRY: 10 CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse + RUSTFLAGS: "-D warnings -W unreachable-pub -W rust-2021-compatibility" + RUSTUP_MAX_RETRIES: 10 + RUST_BACKTRACE: short on: workflow_dispatch: @@ -37,14 +41,14 @@ jobs: run: | apt-get update apt-get install -y libdbus-1-dev pkg-config mandoc libssl-dev - - id: cache-rustup - name: Cache Rust toolchain - uses: https://github.com/actions/cache@v3 - with: - path: ~/.rustup - key: toolchain-${{ matrix.os }}-${{ matrix.rust }} - - if: ${{ steps.cache-rustup.outputs.cache-hit != 'true' }} - name: Install Rust ${{ matrix.rust }} + #- id: cache-rustup + # name: Cache Rust toolchain + # uses: https://github.com/actions/cache@v3 + # with: + # path: ~/.rustup + # key: toolchain-${{ matrix.os }}-${{ matrix.rust }} + #- if: ${{ steps.cache-rustup.outputs.cache-hit != 'true' }} + - name: Install Rust ${{ matrix.rust }} uses: https://github.com/actions-rs/toolchain@v1 with: profile: minimal @@ -59,14 +63,14 @@ jobs: # around a bug in the 'cache' action that causes directories outside of # the workspace dir to be saved/restored incorrectly. run: echo "CARGO_HOME=$(pwd)/.cargo_home" >> $GITHUB_ENV - - id: cache-cargo - name: Cache cargo configuration and installations - uses: https://github.com/actions/cache@v3 - with: - path: ${{ env.CARGO_HOME }} - key: cargo-${{ matrix.os }}-${{ matrix.rust }} - - if: ${{ steps.cache-cargo.outputs.cache-hit != 'true' }} && matrix.target - name: Setup Rust target + #- id: cache-cargo + # name: Cache cargo configuration and installations + # uses: https://github.com/actions/cache@v3 + # with: + # path: ${{ env.CARGO_HOME }} + # key: cargo-${{ matrix.os }}-${{ matrix.rust }} + #- if: ${{ steps.cache-cargo.outputs.cache-hit != 'true' }} && matrix.target + - name: Setup Rust target run: | mkdir -p "${{ env.CARGO_HOME }}" cat << EOF > "${{ env.CARGO_HOME }}"/config.toml @@ -80,10 +84,13 @@ jobs: - name: cargo-check run: | cargo check --all-features --all --tests --examples --benches --bins + - name: Compile + if: success() || failure() + run: cargo test --all --no-fail-fast --all-features --no-run --locked - name: cargo test if: success() || failure() # always run even if other steps fail, except when cancelled run: | - cargo test --all --no-fail-fast --all-features + cargo test --all --no-fail-fast --all-features -- --nocapture --quiet - name: cargo-sort if: success() || failure() run: |