Skip to content

Commit

Permalink
Run test & build CI
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kus committed May 13, 2024
1 parent 1cb44c5 commit d3f1bd6
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 120 deletions.
111 changes: 0 additions & 111 deletions .circleci/config.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build

on:
push:
branches:
- 'master'
tags:
- '*.*.*'
pull_request:
branches:
- 'master'

jobs:
build:
name: Build and push docker images
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
DOCKER_REGISTRY: ghcr.io
DOCKER_IMAGE_BASE: ${{ github.repository_owner }}
outputs:
operator: ${{ steps.meta-tezos-operator.outputs.tags }}
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to the registry
uses: docker/login-action@v1
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set image tags & labels
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/dkg-cli

- name: Image build & push
uses: docker/build-push-action@v2
with:
context: .
file: crates/dkg-cli/Dockerfile
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test

on:
pull_request:
push:
branches:
- 'master'

jobs:
test:
name: Check formatting and run tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.76
override: true
components: rustfmt, clippy

- name: Run tests
run: cargo test
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ run:

start:
./target/release/dkg-cli start -n $(NODE_URL) -p $(PRIVATE_KEY) -c $(CONTRACT_ADDRESS)

image:
docker build -t dkg-cli -f crates/dkg-cli/Dockerfile .
15 changes: 7 additions & 8 deletions crates/dkg-cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
FROM cimg/rust:1.65.0
FROM rust:1.76.0

ENV HOME=/home/circleci
ENV HOME=/root
ENV PATH=$HOME/bin:$PATH

RUN cd $HOME && git clone https://github.com/m-kus/threshold-bls-rs
RUN mkdir $HOME/bin && wget -q https://github.com/ethereum/solidity/releases/download/v0.6.6/solc-static-linux -O $HOME/bin/solc && chmod u+x $HOME/bin/solc && solc --version
RUN cd $HOME && cd threshold-bls-rs/crates/dkg-cli && RUSTFLAGS="-C target-feature=-crt-static" cargo build --release
RUN cd $HOME && git clone https://github.com/trilitech/dkg-tooling
RUN mkdir $HOME/bin && wget -q https://github.com/ethereum/solidity/releases/download/v0.8.25/solc-static-linux -O $HOME/bin/solc && chmod u+x $HOME/bin/solc && solc --version
RUN cd $HOME && cd dkg-tooling/crates/dkg-cli && RUSTFLAGS="-C target-feature=-crt-static" cargo build --release

FROM ubuntu:22.04
COPY --from=0 /home/circleci/threshold-bls-rs/target/release/dkg-cli /dkgbin
WORKDIR /dkg
ENTRYPOINT [ "/dkgbin" ]
COPY --from=0 /root/dkg-tooling/target/release/dkg-cli /usr/bin/
ENTRYPOINT [ "dkg-cli" ]
1 change: 0 additions & 1 deletion crates/dkg-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ in the [Solidity docs](https://solidity.readthedocs.io/en/latest/installing-soli


Install the DKG CLI with `cargo build --release`.
We will use the Alfajores testnet for this example, which you can access by using `https://alfajores-forno.celo-testnet.org` as a `NODE_URL`. You can fund your account by inserting your `address` to the [Alfajores faucet](https://celo.org/developers/faucet).

1. `dkg-cli keygen --path ./keypair`

Expand Down

0 comments on commit d3f1bd6

Please sign in to comment.