-
Notifications
You must be signed in to change notification settings - Fork 5
77 lines (63 loc) · 1.94 KB
/
build-cli.yaml
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
name: build-cli
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
name: build command line interfaces for ${{ matrix.platform || matrix.os }}
strategy:
fail-fast: true
matrix:
os:
- ubuntu
- macos
- windows
include:
- os: ubuntu
platform: linux
- os: windows
ls: dir
runs-on: ${{ format('{0}-latest', matrix.os) }}
steps:
- uses: actions/checkout@v3
- name: set up rust
if: matrix.os != 'ubuntu'
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: set up rust for ubuntu
if: matrix.os == 'ubuntu'
run: >
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=nightly --profile=minimal -y &&
rustup show
- run: rustup target add aarch64-apple-darwin
if: matrix.os == 'macos'
- name: run cargo tests
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: cd rust/fastsim-cli/ && cargo test
- run: cd rust/fastsim-cli/ && cargo build --release
- name: list current directory files
run: ${{ matrix.ls || 'ls -lh' }} ./rust/target/release/
- name: copy cli programs to new directory
if: matrix.os == 'windows'
run: |
mkdir cli
copy ./rust/target/release/vehicle-import-cli.exe cli
copy ./rust/target/release/fastsim-cli.exe cli
- name: copy cli programs to new directory (non-windows)
if: matrix.os != 'windows'
run: |
mkdir cli
cp ./rust/target/release/vehicle-import-cli cli
cp ./rust/target/release/fastsim-cli cli
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-cli
path: ./cli