This repository was archived by the owner on Jun 11, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
ci: add cargo tests #280
Merged
+68
−6
Merged
ci: add cargo tests #280
Changes from 17 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
ad4d801
ci: add cargo tests
tawadaa ae8c8d1
ci: test
tawadaa f377719
ci: add protobuf-compiler
tawadaa b179b3f
ci: add local database
tawadaa 2cc5a88
ci: add work dir
tawadaa 326fe92
ci: add sqlx
tawadaa 2ee7e56
ci: update init_db
tawadaa fb3a092
fix(ci): re-add DB migration in DB init
antoniupop bd33bd4
fix(ci): add DATABASE_URL variable when running tests
antoniupop 3d78f89
fix(ci): add git lfs checkout for keys
antoniupop 0a5bc1e
chore(ci): github actions/cache@v2 are now deprecated, move to v3
antoniupop 9b89270
ci: replace rust toolchain
tawadaa 8e34ba7
ci: add caching to rust-toolchain
tawadaa 5508a37
ci: remove components
tawadaa 46e2bfb
ci: rollback to toolchain and cache actions
tawadaa 0cc55da
ci: fix cargo cache
tawadaa ecf87a5
ci: dd paths
tawadaa 5be5764
ci: update init_db target
tawadaa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Rust tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- .github/workflows/cargo-tests.yml | ||
- fhevm-engine/** | ||
- proto/** | ||
|
||
jobs: | ||
cargo-tests: | ||
permissions: | ||
contents: "read" | ||
id-token: "write" | ||
packages: "write" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
rust: [1.82.0] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
with: | ||
lfs: true | ||
|
||
- name: Checkout LFS objects | ||
run: git lfs checkout | ||
|
||
- name: Set up Rust | ||
uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f # v1.0.6 | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
profile: minimal | ||
override: true | ||
|
||
- name: Install cargo dependencies | ||
run: | | ||
sudo apt-get install -y protobuf-compiler && \ | ||
cargo install sqlx-cli | ||
|
||
- name: Cache cargo | ||
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: ${{ runner.os }}-cargo- | ||
|
||
- name: Init database | ||
run: make init_db | ||
working-directory: fhevm-engine/coprocessor | ||
|
||
- name: Run tests | ||
run: | | ||
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/coprocessor cargo test --release -- --test-threads=1 | ||
working-directory: fhevm-engine |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[toolchain] | ||
channel = "1.82.0" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.