Skip to content

Commit

Permalink
Add Cirrus CI for ARM & x86 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
romanz committed Jun 27, 2023
1 parent c473556 commit 503e897
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 17 deletions.
42 changes: 42 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# task:
# name: test [x86]
# container:
# image: rust:1.63.0
# cpu: 8
# memory: 15G
# registry_cache:
# folder: $CARGO_HOME/registry
# fingerprint_script: cat Cargo.lock
# target_cache:
# folder: target
# fingerprint_script:
# - rustc --version
# - cat Cargo.lock
# build_script:
# - apt-get update
# - apt-get install -qqy clang
# - rustup component add clippy rustfmt
# - cargo build --all --locked
# test_script:
# - cargo test --all --locked
# - cargo clippy -- -D warnings
# - cargo fmt --all -- --check
# before_cache_script: rm -rf $CARGO_HOME/registry/index

task:
name: integration [ARM]
arm_container:
dockerfile: Dockerfile.ci
docker_arguments:
ARCH: aarch64
test_script:
tests/run.sh

task:
name: integration [x86]
container:
dockerfile: Dockerfile.ci
docker_arguments:
ARCH: x86_64
test_script:
tests/run.sh
22 changes: 10 additions & 12 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,13 @@ jobs:
- name: Clippy
run: cargo clippy -- -D warnings

integration:
name: Integration
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build
run: docker build -f Dockerfile.ci . --rm -t electrs:tests

- name: Test
run: docker run -v $PWD/contrib/:/contrib -v $PWD/tests/:/tests --rm electrs:tests bash /tests/run.sh
# integration:
# name: Integration
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Build
# run: docker build -f Dockerfile.ci . --rm -t electrs:tests
# - name: Test
# run: docker run -v $PWD/contrib/:/contrib -v $PWD/tests/:/tests --rm electrs:tests bash /tests/run.sh
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

FROM debian:bookworm-slim as base
RUN apt-get update -qqy
RUN apt-get install -qqy librocksdb-dev curl
RUN apt-get install -qqy librocksdb-dev

### Electrum Rust Server ###
FROM base as electrs-build
RUN apt-get install -qqy cargo clang cmake build-essential
RUN apt-get install -qqy cargo clang cmake

# Install electrs
WORKDIR /build/electrs
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apt-get install -qqy librocksdb-dev wget

### Electrum Rust Server ###
FROM base as electrs-build
RUN apt-get install -qqy cargo clang cmake build-essential
RUN apt-get install -qqy cargo clang cmake

# Install electrs
WORKDIR /build/electrs
Expand All @@ -21,9 +21,10 @@ RUN cargo install --locked --path .
FROM base as bitcoin-build
# Download
WORKDIR /build/bitcoin
ARG ARCH=x86_64
ARG BITCOIND_VERSION=25.0
RUN wget -q https://bitcoincore.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz
RUN tar xvf bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz
RUN wget -q https://bitcoincore.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-$ARCH-linux-gnu.tar.gz
RUN tar xvf bitcoin-$BITCOIND_VERSION-$ARCH-linux-gnu.tar.gz
RUN mv -v bitcoin-$BITCOIND_VERSION/bin/bitcoind .
RUN mv -v bitcoin-$BITCOIND_VERSION/bin/bitcoin-cli .

Expand Down

0 comments on commit 503e897

Please sign in to comment.