Skip to content

Commit cfcfc91

Browse files
authored
Merge branch 'main' into refactor-p2p-config
2 parents 8334e13 + 367cf88 commit cfcfc91

File tree

14 files changed

+200
-41
lines changed

14 files changed

+200
-41
lines changed
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: Testing and Code Coverage
2+
3+
on:
4+
schedule:
5+
# runs 5min after midnight, everyday
6+
- cron: '5 0 * * *'
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
RUSTFLAGS: -D warnings
11+
RUST_BACKTRACE: 1
12+
CARGO_INCREMENTAL: 0
13+
14+
concurrency:
15+
group: ${{ github.sha }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
unit-tests:
20+
name: Unit Tests
21+
runs-on: ubuntu-latest
22+
needs: [integration-tests]
23+
env:
24+
CARGO_FLAGS: --verbose --locked
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v3
28+
29+
- uses: Swatinem/rust-cache@v2
30+
with:
31+
shared-key: "cov"
32+
save-if: "true"
33+
34+
- name: Install Rust toolchain
35+
uses: actions-rs/toolchain@v1
36+
with:
37+
toolchain: "1.65" # it says it can read the rust-toolchain file, but it fails if we omit this
38+
components: llvm-tools-preview
39+
40+
- name: Install cargo-nextest
41+
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
42+
43+
- name: Install cargo-llvm-cov
44+
uses: taiki-e/install-action@cargo-llvm-cov
45+
46+
- name: Install system deps
47+
run:
48+
sudo apt install -y protobuf-compiler libssl-dev libpq-dev libsqlite3-dev pkg-config
49+
50+
- name: Run unit tests
51+
run: |
52+
cargo llvm-cov nextest --no-report --manifest-path ./src/catalyst-toolbox/catalyst-toolbox/Cargo.toml --profile ci
53+
cargo llvm-cov nextest --no-report --manifest-path ./src/catalyst-toolbox/snapshot-lib/Cargo.toml --profile ci
54+
55+
cargo llvm-cov nextest --no-report --manifest-path ./src/vit-servicing-station/vit-servicing-station-cli/Cargo.toml --profile ci
56+
cargo llvm-cov nextest --no-report --manifest-path ./src/vit-servicing-station/vit-servicing-station-lib/Cargo.toml --profile ci
57+
cargo llvm-cov nextest --no-report --manifest-path ./src/vit-servicing-station/vit-servicing-station-server/Cargo.toml --profile ci
58+
59+
cargo llvm-cov nextest --no-report --manifest-path ./src/voting-tools-rs/Cargo.toml --profile ci
60+
61+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-libs/cardano-legacy-address/Cargo.toml --profile ci
62+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-libs/chain-addr/Cargo.toml --profile ci
63+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-libs/chain-core/Cargo.toml --profile ci
64+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-libs/chain-crypto/Cargo.toml --profile ci
65+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-libs/chain-evm/Cargo.toml --profile ci
66+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-libs/chain-impl-mockchain/Cargo.toml --profile ci
67+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-libs/chain-network/Cargo.toml --profile ci
68+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-libs/chain-ser/Cargo.toml --profile ci
69+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-libs/chain-storage/Cargo.toml --profile ci
70+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-libs/chain-time/Cargo.toml --profile ci
71+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-libs/chain-vote/Cargo.toml --profile ci
72+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-libs/imhamt/Cargo.toml --profile ci
73+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-libs/sparse-array/Cargo.toml --profile ci
74+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-libs/typed-bytes/Cargo.toml --profile ci
75+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-wallet-libs/bindings/wallet-c/Cargo.toml --profile ci
76+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-wallet-libs/bindings/wallet-core/Cargo.toml --profile ci
77+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-wallet-libs/bindings/wallet-wasm-js/Cargo.toml --profile ci
78+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-wallet-libs/chain-path-derivation/Cargo.toml --profile ci
79+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-wallet-libs/hdkeygen/Cargo.toml --profile ci
80+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-wallet-libs/symmetric-cipher/Cargo.toml --profile ci
81+
cargo llvm-cov nextest --no-report --manifest-path ./src/chain-wallet-libs/wallet/Cargo.toml --profile ci
82+
83+
cargo llvm-cov nextest --no-report --manifest-path ./src/jormungandr/jormungandr/Cargo.toml --profile ci
84+
cargo llvm-cov report --lcov --output-path ./lcov.info
85+
- name: Upload code coverage to coveralls.io
86+
uses: coverallsapp/github-action@master
87+
with:
88+
github-token: ${{ secrets.GITHUB_TOKEN }}
89+
path-to-lcov: "./lcov.info"
90+
91+
integration-tests:
92+
name: Integration Tests
93+
runs-on: ubuntu-latest
94+
env:
95+
CARGO_FLAGS: --verbose --locked
96+
steps:
97+
- name: Checkout code
98+
uses: actions/checkout@v3
99+
100+
- uses: Swatinem/rust-cache@v2
101+
with:
102+
shared-key: "cov"
103+
save-if: "true"
104+
105+
- name: Install Rust toolchain
106+
uses: actions-rs/toolchain@v1
107+
with:
108+
toolchain: "1.65" # it says it can read the rust-toolchain file, but it fails if we omit this
109+
components: llvm-tools-preview
110+
111+
- name: Install cargo-nextest
112+
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
113+
114+
- name: Install cargo-llvm-cov
115+
uses: taiki-e/install-action@cargo-llvm-cov
116+
117+
- name: Install system deps
118+
run:
119+
sudo apt install -y protobuf-compiler libssl-dev libpq-dev libsqlite3-dev pkg-config
120+
121+
- name: Run integration tests
122+
run: |
123+
source <(cargo llvm-cov show-env --export-prefix)
124+
cargo build -p jcli -p jormungandr -p explorer -p vit-servicing-station-cli -p vit-servicing-station-server
125+
cargo llvm-cov nextest --no-report --manifest-path ./src/vit-servicing-station/vit-servicing-station-tests/Cargo.toml --profile ci
126+
cargo llvm-cov nextest --no-report --manifest-path ./src/jormungandr/testing/jormungandr-integration-tests/Cargo.toml --profile ci

.github/workflows/nix.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,15 @@ jobs:
4242
- name: Standard Discovery
4343
uses: divnix/std-action/discover@main
4444
id: discovery
45-
publish-containers:
45+
build-packages:
4646
needs: discover
4747
strategy:
4848
fail-fast: false
4949
matrix:
50-
target: ${{ fromJSON(needs.discover.outputs.hits).containers.publish }}
50+
target: ${{ fromJSON(needs.discover.outputs.hits).packages.build }}
5151
name: ${{ matrix.target.cell }} - ${{ matrix.target.name }}
5252
runs-on: ubuntu-latest
5353
steps:
54-
- name: Configure Registry
55-
run: |
56-
aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin "${{ env.ECR_REGISTRY }}"
57-
env:
58-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
59-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
60-
AWS_DEFAULT_REGION: eu-central-1
6154
- uses: divnix/std-action/run@main
6255
with:
6356
extra_nix_config: |
@@ -67,15 +60,12 @@ jobs:
6760
s3_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
6861
s3_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
6962
cache: ${{ env.S3_CACHE }}
70-
build-packages:
71-
if: always()
72-
needs:
73-
- discover
74-
- publish-containers
63+
build-devshells:
64+
needs: discover
7565
strategy:
7666
fail-fast: false
7767
matrix:
78-
target: ${{ fromJSON(needs.discover.outputs.hits).packages.build }}
68+
target: ${{ fromJSON(needs.discover.outputs.hits).devshells.build }}
7969
name: ${{ matrix.target.cell }} - ${{ matrix.target.name }}
8070
runs-on: ubuntu-latest
8171
steps:
@@ -88,18 +78,25 @@ jobs:
8878
s3_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
8979
s3_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
9080
cache: ${{ env.S3_CACHE }}
91-
build-devshells:
92-
if: always()
81+
publish-containers:
82+
if: github.ref == 'refs/heads/main'
9383
needs:
9484
- discover
95-
- publish-containers
85+
- build-packages
9686
strategy:
9787
fail-fast: false
9888
matrix:
99-
target: ${{ fromJSON(needs.discover.outputs.hits).devshells.build }}
89+
target: ${{ fromJSON(needs.discover.outputs.hits).containers.publish }}
10090
name: ${{ matrix.target.cell }} - ${{ matrix.target.name }}
10191
runs-on: ubuntu-latest
10292
steps:
93+
- name: Configure Registry
94+
run: |
95+
aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin "${{ env.ECR_REGISTRY }}"
96+
env:
97+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
98+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
99+
AWS_DEFAULT_REGION: eu-central-1
103100
- uses: divnix/std-action/run@main
104101
with:
105102
extra_nix_config: |

.std/automation/devshells/dev/shell-profile

Lines changed: 0 additions & 1 deletion
This file was deleted.

.std/automation/devshells/dev/shell-profile-1-link

Lines changed: 0 additions & 1 deletion
This file was deleted.

.std/automation/devshells/dev/shell-profile-2-link

Lines changed: 0 additions & 1 deletion
This file was deleted.

.std/automation/devshells/dev/shell-profile-3-link

Lines changed: 0 additions & 1 deletion
This file was deleted.

.std/automation/devshells/dev/shell-profile-4-link

Lines changed: 0 additions & 1 deletion
This file was deleted.

.std/automation/devshells/dev/shell-profile-5-link

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
<a href="https://github.com/input-output-hk/catalyst-core/blob/main/CODE_OF_CONDUCT.md">
1515
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome!" />
1616
</a>
17+
<a href='https://coveralls.io/github/input-output-hk/catalyst-core?branch=main'>
18+
<img src='https://coveralls.io/repos/github/input-output-hk/catalyst-core/badge.svg?branch=main' alt='Coverage Status' />
19+
</a>
1720
</p>
1821

1922
# Content

lefthook.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)