This repository has been archived by the owner on Jul 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
94 lines (77 loc) · 2.65 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: CI
on:
push:
branches: [main]
pull_request:
schedule:
- cron: "14 04 * * *" # Daily at 9:14 PM PDT, 8:14 PM PST.
jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected]
with:
cancel_others: "true"
test:
name: Test
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.event_name != 'pull_request' }}
timeout-minutes: 10
needs: pre_job
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: nightly
components: rustfmt, clippy
- name: Install Action cargo-generate
uses: cargo-generate/[email protected]
with:
name: generated
- name: Move generated project
run: |
mv generated ${{ runner.temp }}/
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path "${{ runner.temp }}/generated/Cargo.toml" --all-targets
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path "${{ runner.temp }}/generated/Cargo.toml" --all -- --check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path "${{ runner.temp }}/generated/Cargo.toml" --all --all-targets -- -D warnings
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path "${{ runner.temp }}/generated/Cargo.toml" --all-targets --no-fail-fast
- name: Run cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path "${{ runner.temp }}/generated/Cargo.toml" --all-targets
- name: test template example
run: |
ECHO_STRING='hello this is a test'
trap 'rm client-input && rm client-output && kill $(jobs -p)' EXIT
echo "$ECHO_STRING" >client-input
"${{ runner.temp }}/generated/target/debug/hydroflow-template" --role server --address 127.0.0.100:2048 &
"${{ runner.temp }}/generated/target/debug/hydroflow-template" --role client --address 127.0.0.100:2048 <client-input >client-output &
sleep 1
if cat client-output | grep -q "$ECHO_STRING"; then
exit 0
else
exit -1
fi