mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-09-18 20:04:38 -04:00
Update rust-toolchain to new toml syntax
This allows us to completely skip the "Install Rust" step in CI because the rust-toolchain file completely describes what we need. The first invocation of cargo will simply install all the required components. Additionally, we make all caches dependant on the version of Rust that we require.
This commit is contained in:
parent
8072f4d7ee
commit
fb45ff66eb
2 changed files with 7 additions and 30 deletions
33
.github/workflows/ci.yml
vendored
33
.github/workflows/ci.yml
vendored
|
@ -15,19 +15,12 @@ jobs:
|
|||
- name: Checkout sources
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: Cache ~/.cargo/bin directory
|
||||
id: cargo-bin-cache
|
||||
uses: actions/cache@v2.1.4
|
||||
with:
|
||||
path: ~/.cargo/bin
|
||||
key: ubuntu-rust-${{ env.RUST_TOOLCHAIN }}-cargo-bin-directory-v1
|
||||
key: ubuntu-rust-${{ hashFiles('rust-toolchain') }}-cargo-bin-directory-v1
|
||||
|
||||
- name: Install tomlfmt
|
||||
if: steps.cargo-bin-cache.outputs.cache-hit != 'true'
|
||||
|
@ -63,19 +56,13 @@ jobs:
|
|||
- name: Checkout sources
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
override: true
|
||||
|
||||
- name: Cache target and registry directory
|
||||
uses: actions/cache@v2.1.4
|
||||
with:
|
||||
path: |
|
||||
target
|
||||
~/.cargo/registry
|
||||
key: rust-${{ matrix.target }}-build-${{ hashFiles('Cargo.lock') }}-v1
|
||||
key: rust-${{ matrix.target }}-build-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('rust-toolchain') }}-v1
|
||||
|
||||
- name: Build binary
|
||||
run: |
|
||||
|
@ -110,19 +97,13 @@ jobs:
|
|||
- name: Checkout sources
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
override: true
|
||||
|
||||
- name: Cache target and registry directory
|
||||
uses: actions/cache@v2.1.4
|
||||
with:
|
||||
path: |
|
||||
target
|
||||
~/.cargo/registry
|
||||
key: rust-${{ matrix.target }}-test-${{ hashFiles('Cargo.lock') }}-v1
|
||||
key: rust-${{ matrix.target }}-test-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('rust-toolchain') }}-v1
|
||||
|
||||
- name: Build tests
|
||||
run: cargo build --tests --workspace --all-features
|
||||
|
@ -152,19 +133,13 @@ jobs:
|
|||
- name: Checkout sources
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
override: true
|
||||
|
||||
- name: Cache target and registry directory
|
||||
uses: actions/cache@v2.1.4
|
||||
with:
|
||||
path: |
|
||||
target
|
||||
~/.cargo/registry
|
||||
key: rust-${{ matrix.target }}-test-${{ hashFiles('Cargo.lock') }}-v1
|
||||
key: rust-${{ matrix.target }}-test-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('rust-toolchain') }}-v1
|
||||
|
||||
- name: Run test ${{ matrix.test_name }}
|
||||
run: cargo test --package swap --all-features --test ${{ matrix.test_name }} ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue