10
10
branches :
11
11
- " **"
12
12
13
+ concurrency :
14
+ group : ${{ github.event_name == 'pull_request' && format('{0}-{1}', github.workflow_ref, github.event.pull_request.number) || github.run_id }}
15
+ cancel-in-progress : true
16
+
13
17
permissions :
14
18
id-token : write
15
19
contents : read
@@ -32,16 +36,11 @@ jobs:
32
36
cd rust_bindings
33
37
cargo fuzz list | xargs -I "%" sh -c "cargo +nightly fuzz run % -- -max_total_time=600 || exit 255"
34
38
35
- build_crate :
36
- name : Build crate
39
+ lint :
40
+ name : Lint
37
41
runs-on : ubuntu-latest
38
- strategy :
39
- fail-fast : false
40
-
41
42
steps :
42
43
- uses : actions/checkout@v4
43
- with :
44
- fetch-depth : 0
45
44
46
45
- name : Set up Rust
47
46
uses : dtolnay/rust-toolchain@stable
@@ -54,14 +53,92 @@ jobs:
54
53
- name : Clippy
55
54
run : cargo clippy
56
55
56
+ test :
57
+ name : Test (${{ matrix.os.name }} ${{ matrix.arch.name }})
58
+ runs-on : ${{ matrix.os.runs-on[matrix.arch.matrix] }}
59
+
60
+ strategy :
61
+ fail-fast : false
62
+ matrix :
63
+ os :
64
+ - name : macOS
65
+ matrix : macos
66
+ runs-on :
67
+ arm : [macos-13-arm64]
68
+ intel : [macos-13]
69
+ cibw-archs-macos :
70
+ arm : arm64
71
+ intel : x86_64
72
+ - name : Ubuntu
73
+ matrix : ubuntu
74
+ runs-on :
75
+ arm : [Linux, ARM64]
76
+ intel : [ubuntu-latest]
77
+ - name : Windows
78
+ matrix : windows
79
+ runs-on :
80
+ intel : [windows-latest]
81
+
82
+ arch :
83
+ - name : ARM
84
+ matrix : arm
85
+ - name : Intel
86
+ matrix : intel
87
+
88
+ exclude :
89
+ - os :
90
+ name : Windows
91
+ matrix : windows
92
+ runs-on :
93
+ intel : [windows-latest]
94
+ arch :
95
+ name : ARM
96
+ matrix : arm
97
+
98
+ steps :
99
+ - uses : actions/checkout@v4
100
+
101
+ - name : Setup library path on MacOS
102
+ if : matrix.os.name == 'macOS'
103
+ run : echo "LIBRARY_PATH=/opt/homebrew/lib:$LIBRARY_PATH" >> $GITHUB_ENV
104
+
105
+ - name : Install MPIR on Windows
106
+ if : matrix.os.name == 'Windows'
107
+ run : |
108
+ git clone https://github.com/Chia-Network/mpir_gc_x64.git
109
+ "$(Get-Location)/mpir_gc_x64" | Out-File -Append -FilePath $env:GITHUB_PATH
110
+
111
+ - name : Install libclang-dev on Linux
112
+ if : matrix.os.name == 'Ubuntu'
113
+ run : sudo apt-get install libclang-dev -y
114
+
115
+ - name : Set up Rust
116
+ uses : dtolnay/rust-toolchain@stable
117
+
57
118
- name : Tests
58
119
run : cargo test && cargo test --release
59
120
121
+ build_crate :
122
+ name : Build crate
123
+ needs : [lint, test]
124
+ runs-on : ubuntu-latest
125
+ strategy :
126
+ fail-fast : false
127
+
128
+ steps :
129
+ - uses : actions/checkout@v4
130
+
131
+ - name : Set up Rust
132
+ uses : dtolnay/rust-toolchain@stable
133
+
60
134
- name : Build
61
135
run : cargo build --release
62
136
63
137
- name : Prepare for publish
64
- run : cp -r src rust_bindings/cpp
138
+ run : |
139
+ cd rust_bindings
140
+ cp -r ../src cpp
141
+ git clone https://github.com/Chia-Network/mpir_gc_x64.git
65
142
66
143
- name : Publish to crates.io (dry run)
67
144
# We use `--allow-dirty` because the `cpp` folder is copied into the working directory.
0 commit comments