-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (64 loc) · 1.99 KB
/
rust.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
name: Rust
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build on ${{ matrix.os.runs-on }}
runs-on: ${{ matrix.os.runs-on }}
strategy:
matrix:
os:
- runs-on: ubuntu-latest
exec: history_archiver
artifact_name: history_archiver_linux
- runs-on: windows-latest
exec: history_archiver.exe
artifact_name: history_archiver_windows.exe
steps:
- uses: actions/checkout@v3
- name: Build
working-directory: history_archiver
run: cargo build -r --verbose
- name: Run tests
working-directory: history_archiver
run: cargo test -r --verbose
- name: Compress
uses: crazy-max/ghaction-upx@v2
with:
version: latest
files: history_archiver/target/release/${{ matrix.os.exec }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os.artifact_name }}
path: history_archiver/target/release/${{ matrix.os.exec }}
build_macos:
name: Build on macos
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: aarch64-apple-darwin
profile: minimal
override: true
- name: Run tests
working-directory: history_archiver
run: cargo test --target=x86_64-apple-darwin -r --verbose
- name: Build
working-directory: history_archiver
run: |
cargo build --target=aarch64-apple-darwin -r --verbose
cargo build --target=x86_64-apple-darwin -r --verbose
lipo -create -output history_archiver_macos target/aarch64-apple-darwin/release/history_archiver target/x86_64-apple-darwin/release/history_archiver
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: history_archiver_macos
path: history_archiver/history_archiver_macos