CI: remove --release from unused artifacts
[ouch.git] / .github / workflows / build.yml
blobaa88a1db7976c86b9ca6d4dd68fe0a7a76242675
1 on: [push, pull_request]
3 name: build-and-test
6 jobs:
7   aarch64-glibc:
8     name: Ubuntu 18.04 (for ARMv8 - glibc)
9     runs-on: ubuntu-18.04
10     steps:
11       - uses: actions/checkout@v2
12       - uses: actions-rs/toolchain@v1
13         with:
14           toolchain: stable
15           target: aarch64-unknown-linux-gnu
16           override: true
18       - name: Install binutils-arm-none-eabi
19         run: |
20           sudo apt-get update
21           sudo apt-get install binutils-aarch64-linux-gnu
23       - uses: actions-rs/cargo@v1
24         with:
25           use-cross: true
26           command: build
27           args: --target=aarch64-unknown-linux-gnu
29       - name: Run cargo test
30         uses: actions-rs/cargo@v1
31         with:
32           use-cross: true
33           command: test
34           args: --target=aarch64-unknown-linux-gnu
36       - name: Strip binary
37         run: aarch64-linux-gnu-strip target/aarch64-unknown-linux-gnu/release/ouch
39       # - name: Upload binary
40       #   uses: actions/upload-artifact@v2
41       #   with:
42       #     name: 'ouch-aarch64-linux-gnu'
43       #     path: target/aarch64-unknown-linux-gnu/release/ouch
46   armv7-glibc:
47     name: Ubuntu 18.04 (for ARMv7 - glibc)
48     runs-on: ubuntu-18.04
49     steps:
50       - uses: actions/checkout@v2
51       - uses: actions-rs/toolchain@v1
52         with:
53           toolchain: stable
54           target: armv7-unknown-linux-gnueabihf
55           override: true
57       - name: Install binutils-arm-none-eabi
58         run: |
59           sudo apt-get update
60           sudo apt-get install binutils-arm-none-eabi
62       - uses: actions-rs/cargo@v1
63         with:
64           use-cross: true
65           command: build
66           args: --target=armv7-unknown-linux-gnueabihf
68       - name: Run cargo test
69         uses: actions-rs/cargo@v1
70         with:
71           use-cross: true
72           command: test
73           args: --target=armv7-unknown-linux-gnueabihf
75       - name: Strip binary
76         run: arm-none-eabi-strip target/armv7-unknown-linux-gnueabihf/release/ouch
78       # - name: Upload binary
79       #   uses: actions/upload-artifact@v2
80       #   with:
81       #     name: 'ouch-armv7-linux-gnueabihf'
82       #     path: target/armv7-unknown-linux-gnueabihf/release/ouch
85   x86_64_musl:
86     name: Ubuntu 20.04 (musl)
87     runs-on: ubuntu-20.04
88     strategy:
89       matrix:
90         rust:
91           - stable
92     steps:
93       - name: Checkout sources
94         uses: actions/checkout@v2
96       - name: Install toolchain
97         uses: actions-rs/toolchain@v1
98         with:
99           toolchain: stable
100           target: x86_64-unknown-linux-musl
101           override: true
103       - name: Install dependencies for musl libc
104         run: |
105           sudo apt-get update
106           sudo apt-get install musl-tools
108       - name: Run cargo build
109         uses: actions-rs/cargo@v1
110         with:
111           command: build
112           args: --release --target x86_64-unknown-linux-musl
114       - name: Run cargo test
115         uses: actions-rs/cargo@v1
116         with:
117           command: test
118           args: --target x86_64-unknown-linux-musl
120       - name: Strip binary
121         run: strip target/x86_64-unknown-linux-musl/release/ouch
123       - name: Upload binary
124         uses: actions/upload-artifact@v2
125         with:
126           name: 'ouch-x86_64-linux-musl'
127           path: target/x86_64-unknown-linux-musl/release/ouch
130   x86_64_glibc:
131     name: Ubuntu 18.04 (glibc)
132     runs-on: ubuntu-18.04
133     strategy:
134       matrix:
135         rust:
136           - stable
137     steps:
138       - name: Checkout sources
139         uses: actions/checkout@v2
141       - name: Install toolchain
142         uses: actions-rs/toolchain@v1
143         with:
144           toolchain: stable
145           override: true
147       - name: Run cargo build
148         uses: actions-rs/cargo@v1
149         with:
150           command: build
152       - name: Run cargo test
153         uses: actions-rs/cargo@v1
154         with:
155           command: test
157       - name: Strip binary
158         run: strip target/release/ouch
160       # - name: Upload binary
161       #   uses: actions/upload-artifact@v2
162       #   with:
163       #     name: 'ouch-x86_64-linux-gnu'
164       #     path: target/release/ouch
167   x86_64_macos:
168     name: macOS (x86_64)
169     runs-on: macos-latest
170     strategy:
171       matrix:
172         rust:
173           - stable
174     steps:
175       - name: Checkout sources
176         uses: actions/checkout@v2
178       - name: Install toolchain
179         uses: actions-rs/toolchain@v1
180         with:
181           toolchain: stable
182           target: x86_64-apple-darwin
183           override: true
185       - name: Run cargo build
186         uses: actions-rs/cargo@v1
187         with:
188           command: build
189           args: --release
191       - name: Run cargo test
192         uses: actions-rs/cargo@v1
193         with:
194           command: test
196       - name: Strip binary
197         run: strip target/release/ouch
199       - name: Upload binary
200         uses: actions/upload-artifact@v2
201         with:
202           name: 'ouch-x86_64-apple-darwin'
203           path: target/release/ouch
206   windows-msvc:
207     name: Windows Server (MSVC)
208     runs-on: windows-latest
209     strategy:
210       matrix:
211         rust:
212           - stable
213     steps:
214       - name: Checkout sources
215         uses: actions/checkout@v2
217       - name: Install toolchain
218         uses: actions-rs/toolchain@v1
219         with:
220           toolchain: ${{ matrix.rust }}
221           override: true
223       - name: Run cargo build
224         uses: actions-rs/cargo@v1
225         with:
226           command: build
227           args: --release
229       - name: Run cargo test
230         uses: actions-rs/cargo@v1
231         with:
232           command: test
234       - name: Upload binary
235         uses: actions/upload-artifact@v2
236         with:
237           name: 'ouch-x86_64-pc-windows-msvc'
238           path: target\release\ouch.exe
241   windows-mingw:
242     name: Windows Server (MinGW)
243     runs-on: windows-2019
244     strategy:
245       matrix:
246         rust:
247           - stable
248     steps:
249       - name: Checkout sources
250         uses: actions/checkout@v2
252       - name: Install toolchain
253         uses: actions-rs/toolchain@v1
254         with:
255           toolchain: stable
256           target: x86_64-pc-windows-gnu
257           override: true
259       - name: Run cargo build
260         uses: actions-rs/cargo@v1
261         with:
262           command: build
263           args: --target x86_64-pc-windows-gnu
265       - name: Run cargo test
266         uses: actions-rs/cargo@v1
267         with:
268           command: test
269           args: --target x86_64-pc-windows-gnu
271       # - name: Upload binary
272       #   uses: actions/upload-artifact@v2
273       #   with:
274       #     name: 'ouch-x86_64-pc-windows-gnu'
275       #     path: target\x86_64-pc-windows-gnu\release\ouch.exe