Skip to content

Commit f783763

Browse files
ci: adding Rust unit testing (#16)
1 parent 324b061 commit f783763

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,13 @@ jobs:
4343
uses: actions/checkout@v3
4444
- name: Compile.
4545
run: earthly --ci +compile
46+
unit-test:
47+
name: Unit Test
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Download Earthly v0.8.12.
51+
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.8.12/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'"
52+
- name: Checkout code.
53+
uses: actions/checkout@v3
54+
- name: Unit test.
55+
run: earthly --ci +unit-test

Earthfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,9 @@ compile:
138138
RUN ./ci/compile.sh
139139
SAVE ARTIFACT "target/" AS LOCAL "./"
140140
SAVE ARTIFACT "Cargo.lock" AS LOCAL "./"
141+
142+
143+
unit-test:
144+
FROM +rust-base
145+
DO +COPY_SOURCECODE
146+
RUN ./ci/unit-test.sh

ci/unit-test.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env sh
2+
3+
set -o errexit
4+
set -o xtrace
5+
6+
cargo test --verbose --workspace
7+
cargo test --verbose --workspace --all-features
8+
cargo test --verbose --workspace --no-default-features

0 commit comments

Comments
 (0)