Skip to content

Commit

Permalink
Merge pull request #175 from openmina/develop
Browse files Browse the repository at this point in the history
Merge `develop` into `main`
  • Loading branch information
tizoc committed Dec 22, 2023
2 parents 7ed81c9 + 908286f commit 9f8b151
Show file tree
Hide file tree
Showing 653 changed files with 55,941 additions and 2,997 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
@@ -1,5 +1,7 @@
target/
Dockerfile
Dockerfile_FE
docker-compose.yml
.dockerignore
cli/bin
cli/tests
Expand Down
332 changes: 275 additions & 57 deletions .drone.yml

Large diffs are not rendered by default.

122 changes: 104 additions & 18 deletions .github/workflows/ci.yaml
@@ -1,34 +1,120 @@
name: Openmina CI
on: [ push, pull_request, workflow_dispatch ]
on:
push:
branches: [ main, develop ]
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Git checkout
uses: actions/checkout@v3

- name: Setup Rust
uses: actions-rs/toolchain@v1
run: |
rustup install nightly
rustup override set nightly
rustup component add clippy rustfmt
# - name: Check
# uses: actions-rs/cargo@v1
# with:
# command: check

# - name: Clippy
# uses: actions-rs/cargo@v1
# with:
# command: clippy
# # don't fail the job until clippy is fixed
# continue-on-error: true

- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
with:
toolchain: nightly
override: true
components: rustfmt, clippy
prefix-key: "ver-0"

- name: Release build
run: |
cargo build --release --bin openmina
- name: Check
uses: actions-rs/cargo@v1
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
command: check
name: bin
path: target/release/openmina

- name: Clippy
uses: actions-rs/cargo@v1
- name: Build tests
run: |
mkdir target/release/tests
cargo build --release --features=scenario-generators --package=openmina-node-testing --tests
cargo build --release --features=scenario-generators --package=openmina-node-testing --tests --message-format=json > cargo-build-test.json
jq -r '. | select(.executable != null and (.target.kind | (contains(["test"])))) | [.target.name, .executable ] | @tsv' cargo-build-test.json > tests.tsv
while read NAME FILE; do cp -a $FILE target/release/tests/$NAME; done < tests.tsv
cargo build --release --features=scenario-generators,p2p-webrtc --package=openmina-node-testing --tests
cargo build --release --features=scenario-generators,p2p-webrtc --package=openmina-node-testing --tests --message-format=json > cargo-build-test.json
jq -r '. | select(.executable != null and (.target.kind | (contains(["test"])))) | [.target.name, .executable ] | @tsv' cargo-build-test.json > tests.tsv
while read NAME FILE; do cp -a $FILE target/release/tests/webrtc_$NAME; done < tests.tsv
tar cf tests.tar -C target/release/tests .
- name: Upload tests
uses: actions/upload-artifact@v3
with:
command: clippy
# don't fail the job until clippy is fixed
continue-on-error: true
name: tests
path: tests.tar

- name: Release build
uses: actions-rs/cargo@v1
p2p-tests:
needs: [ build ]
runs-on: ubuntu-20.04
container:
image: minaprotocol/mina-daemon:2.0.0rampup4-14047c5-focal-berkeley
strategy:
matrix:
test: [p2p_basic_connections, p2p_basic_incoming, p2p_basic_outgoing]
fail-fast: false

steps:
- name: Download tests
uses: actions/download-artifact@v3
with:
name: tests

- name: Unpack tests
run: |
tar xf tests.tar ./${{ matrix.test }}
- name: Run the test
run: |
./${{ matrix.test }} --nocapture --test-threads=1
scenario-tests:
needs: [ build ]
runs-on: ubuntu-20.04
container:
image: minaprotocol/mina-daemon:2.0.0rampup4-14047c5-focal-berkeley
strategy:
matrix:
test: [single_node, multi_node, connection_discovery, webrtc_single_node, webrtc_multi_node]
fail-fast: false

steps:
- name: Download tests
uses: actions/download-artifact@v3
with:
command: build
args: --release --bin openmina
name: tests

- name: Unpack tests
run: |
tar xf tests.tar ./${{ matrix.test }}
- name: Run the test
run: |
./${{ matrix.test }} --nocapture --test-threads=1
1 change: 1 addition & 0 deletions .gitignore
@@ -1 +1,2 @@
/target
/node/testing/res/
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/openmina.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9f8b151

Please sign in to comment.