Skip to content

Commit

Permalink
ci: update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
realeinherjar committed Oct 12, 2023
1 parent ffe900b commit c19dff9
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 70 deletions.
138 changes: 71 additions & 67 deletions .github/workflows/cont_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,73 +32,77 @@ jobs:
uses: DeterminateSystems/nix-installer-action@v5
- name: Rust Cache
uses: Swatinem/rust-cache@v2.2.1
- name: Pin dependencies for MSRV
if: matrix.rust.version == 'MSRV'
run: |
nix develop -L .#test.MSRV --command bash -c 'cargo update -p log --precise "0.4.18"'
nix develop -L .#test.MSRV --command bash -c 'cargo update -p tempfile --precise "3.6.0"'
nix develop -L .#test.MSRV --command bash -c 'cargo update -p rustls:0.21.7 --precise "0.21.1"'
nix develop -L .#test.MSRV --command bash -c 'cargo update -p rustls:0.20.9 --precise "0.20.8"'
nix develop -L .#test.MSRV --command bash -c 'cargo update -p tokio:1.33.0 --precise "1.29.1"'
nix develop -L .#test.MSRV --command bash -c 'cargo update -p tokio-util --precise "0.7.8"'
nix develop -L .#test.MSRV --command bash -c 'cargo update -p flate2:1.0.27 --precise "1.0.26"'
nix develop -L .#test.MSRV --command bash -c 'cargo update -p reqwest --precise "0.11.18"'
nix develop -L .#test.MSRV --command bash -c 'cargo update -p h2 --precise "0.3.20"'
nix develop -L .#test.MSRV --command bash -c 'cargo update -p rustls-webpki:0.100.3 --precise "0.100.1"'
nix develop -L .#test.MSRV --command bash -c 'cargo update -p rustls-webpki:0.101.6 --precise "0.101.1"'
nix develop -L .#test.MSRV --command bash -c 'cargo update -p zip:0.6.6 --precise "0.6.2"'
nix develop -L .#test.MSRV --command bash -c 'cargo update -p time --precise "0.3.13"'
nix develop -L .#test.MSRV --command bash -c 'cargo update -p cc --precise "1.0.81"'
nix develop -L .#test.MSRV --command bash -c 'cargo update -p byteorder --precise "1.4.3"'
nix develop -L .#test.MSRV --command bash -c 'cargo update -p webpki --precise "0.22.2"'
nix develop -L .#test.MSRV --command bash -c 'cargo update -p jobserver --precise "0.1.26"'
- name: Build
run: 'nix develop -L .#test.${{ matrix.rust.version }} --command bash -c "cargo build ${{ matrix.features }}"'
- name: Test
run: 'nix develop -L .#test.${{ matrix.rust.version }} --command bash -c "cargo test ${{ matrix.features }}"'
- name: Build ${{ matrix.rust.version }}
run: nix build -L $${{ matrix.rust.version }} --keep-failed
- name: Test ${{ matrix.rust.version }}
run: nix build -L .#test.$${{ matrix.rust.version }} --keep-failed
# - name: Pin dependencies for MSRV
# if: matrix.rust.version == 'MSRV'
# run: |
# nix develop -L .#test.MSRV --command bash -c 'cargo update -p log --precise "0.4.18"'
# nix develop -L .#test.MSRV --command bash -c 'cargo update -p tempfile --precise "3.6.0"'
# nix develop -L .#test.MSRV --command bash -c 'cargo update -p rustls:0.21.7 --precise "0.21.1"'
# nix develop -L .#test.MSRV --command bash -c 'cargo update -p rustls:0.20.9 --precise "0.20.8"'
# nix develop -L .#test.MSRV --command bash -c 'cargo update -p tokio:1.33.0 --precise "1.29.1"'
# nix develop -L .#test.MSRV --command bash -c 'cargo update -p tokio-util --precise "0.7.8"'
# nix develop -L .#test.MSRV --command bash -c 'cargo update -p flate2:1.0.27 --precise "1.0.26"'
# nix develop -L .#test.MSRV --command bash -c 'cargo update -p reqwest --precise "0.11.18"'
# nix develop -L .#test.MSRV --command bash -c 'cargo update -p h2 --precise "0.3.20"'
# nix develop -L .#test.MSRV --command bash -c 'cargo update -p rustls-webpki:0.100.3 --precise "0.100.1"'
# nix develop -L .#test.MSRV --command bash -c 'cargo update -p rustls-webpki:0.101.6 --precise "0.101.1"'
# nix develop -L .#test.MSRV --command bash -c 'cargo update -p zip:0.6.6 --precise "0.6.2"'
# nix develop -L .#test.MSRV --command bash -c 'cargo update -p time --precise "0.3.13"'
# nix develop -L .#test.MSRV --command bash -c 'cargo update -p cc --precise "1.0.81"'
# nix develop -L .#test.MSRV --command bash -c 'cargo update -p byteorder --precise "1.4.3"'
# nix develop -L .#test.MSRV --command bash -c 'cargo update -p webpki --precise "0.22.2"'
# nix develop -L .#test.MSRV --command bash -c 'cargo update -p jobserver --precise "0.1.26"'
# - name: Build
# run: 'nix develop -L .#test.${{ matrix.rust.version }} --command bash -c "cargo build ${{ matrix.features }}"'
# - name: Test
# run: 'nix develop -L .#test.${{ matrix.rust.version }} --command bash -c "cargo test ${{ matrix.features }}"'

check-no-std:
name: Check no_std
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v5
- name: Rust Cache
uses: Swatinem/rust-cache@v2.2.1
- name: Check bdk_chain
working-directory: ./crates/chain
# TODO "--target thumbv6m-none-eabi" should work but currently does not
run: 'nix develop -L .#test.stable --command bash -c "cargo check --no-default-features --features bitcoin/no-std,miniscript/no-std,hashbrown"'
- name: Check bdk
working-directory: ./crates/bdk
# TODO "--target thumbv6m-none-eabi" should work but currently does not
run: 'nix develop -L .#test.stable --command bash -c "cargo check --no-default-features --features bitcoin/no-std,miniscript/no-std,bdk_chain/hashbrown"'
- name: Check esplora
working-directory: ./crates/esplora
# TODO "--target thumbv6m-none-eabi" should work but currently does not
run: 'nix develop -L .#test.stable --command bash -c "cargo check --no-default-features --features bitcoin/no-std,miniscript/no-std,bdk_chain/hashbrown"'
# check-no-std:
# name: Check no_std
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Install Nix
# uses: DeterminateSystems/nix-installer-action@v5
# - name: Rust Cache
# uses: Swatinem/rust-cache@v2.2.1
# - name: Check bdk_chain
# working-directory: ./crates/chain
# # TODO "--target thumbv6m-none-eabi" should work but currently does not
# run: 'nix develop -L .#test.stable --command bash -c "cargo check --no-default-features --features bitcoin/no-std,miniscript/no-std,hashbrown"'
# - name: Check bdk
# working-directory: ./crates/bdk
# # TODO "--target thumbv6m-none-eabi" should work but currently does not
# run: 'nix develop -L .#test.stable --command bash -c "cargo check --no-default-features --features bitcoin/no-std,miniscript/no-std,bdk_chain/hashbrown"'
# - name: Check esplora
# working-directory: ./crates/esplora
# # TODO "--target thumbv6m-none-eabi" should work but currently does not
# run: 'nix develop -L .#test.stable --command bash -c "cargo check --no-default-features --features bitcoin/no-std,miniscript/no-std,bdk_chain/hashbrown"'

check-wasm:
name: Check WASM
runs-on: ubuntu-20.04
env:
CC: clang-10
CFLAGS: -I/usr/include
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v5
- name: Rust Cache
uses: Swatinem/rust-cache@v2.2.1
- name: Check bdk
working-directory: ./crates/bdk
run: 'nix develop -L .#test.WASM --command bash -c "cargo check --target wasm32-unknown-unknown --no-default-features --features bitcoin/no-std,miniscript/no-std,bdk_chain/hashbrown,dev-getrandom-wasm"'
- name: Check esplora
working-directory: ./crates/esplora
run: 'nix develop -L .#test.WASM --command bash -c "cargo check --target wasm32-unknown-unknown --no-default-features --features bitcoin/no-std,miniscript/no-std,bdk_chain/hashbrown,async"'
# check-wasm:
# name: Check WASM
# runs-on: ubuntu-20.04
# env:
# CC: clang-10
# CFLAGS: -I/usr/include
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Install Nix
# uses: DeterminateSystems/nix-installer-action@v5
# - name: Rust Cache
# uses: Swatinem/rust-cache@v2.2.1
# - name: Check bdk
# working-directory: ./crates/bdk
# run: 'nix develop -L .#test.WASM --command bash -c "cargo check --target wasm32-unknown-unknown --no-default-features --features bitcoin/no-std,miniscript/no-std,bdk_chain/hashbrown,dev-getrandom-wasm"'
# - name: Check esplora
# working-directory: ./crates/esplora
# run: 'nix develop -L .#test.WASM --command bash -c "cargo check --target wasm32-unknown-unknown --no-default-features --features bitcoin/no-std,miniscript/no-std,bdk_chain/hashbrown,async"'

fmt:
name: Rust fmt
Expand All @@ -109,7 +113,7 @@ jobs:
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v5
- name: Check fmt
run: 'nix develop -L .#test.stable --command bash -c "cargo fmt --all -- --config format_code_in_doc_comments=true --check"'
run: 'nix develop -L . --command bash -c "cargo fmt --all -- --config format_code_in_doc_comments=true --check"'

clippy_check:
runs-on: ubuntu-latest
Expand All @@ -120,4 +124,4 @@ jobs:
- name: Rust Cache
uses: Swatinem/rust-cache@v2.2.1
- name: Clippy
run: 'nix develop -L .#clippy --command bash -c "cargo clippy --all-features --all-targets -- -D warnings"'
run: nix build -L .#checks.x86_64-linux.clippy --keep-failed
11 changes: 8 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@
buildStable = craneLib.cargoBuild (commonArgs // {
inherit cargoArtifacts;
});
buildMSRV = craneMSRVLib.cargoBuild (commonArgs // { });
buildMSRV = craneMSRVLib.cargoBuild (commonArgs // {
inherit cargoArtifacts;
});
# TODO:
# cargo update -p log --precise "0.4.18"
# cargo update -p tempfile --precise "3.6.0"
Expand All @@ -143,7 +145,6 @@
inherit cargoArtifacts;
});


# WASM
#
# Note that this is done as a separate derivation so it
Expand Down Expand Up @@ -189,7 +190,11 @@
stable = buildStable;
MSRV = buildMSRV;
};
legacyPackages = { };
legacyPackages = {
test = {
stable = testStable;
};
};

devShells.default = craneLib.devShell {
# Inherit inputs from checks
Expand Down

0 comments on commit c19dff9

Please sign in to comment.