-
Notifications
You must be signed in to change notification settings - Fork 59
89 lines (76 loc) · 2.72 KB
/
nightly.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
name: Nightly builds
on:
push:
branches:
- master
jobs:
binary:
name: Binary (${{ matrix.target }})
runs-on: ${{ contains(matrix.target, 'windows') && 'windows-latest' || 'ubuntu-18.04' }}
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
env:
EXE_EXT: ${{ contains(matrix.target, 'windows') && '.exe' || '' }}
EXE_PATH: ${{ contains(matrix.target, 'x86_64') && '' || format('/{0}', matrix.target) }}
LIBCLANG_PATH: ${{ contains(matrix.target, 'windows') && 'C:\ProgramData\scoop\apps\llvm\current\bin' || '/usr/lib/x86_64-linux-gnu/' }}
steps:
- name: Checkout the source code
uses: actions/checkout@v2
with:
submodules: true
- name: Install LLVM (for windows)
if: contains(matrix.target, 'windows')
run: |
iwr -useb get.scoop.sh | iex
scoop install llvm --global
- name: Install ARM64 multilib
if: contains(matrix.target, 'aarch64')
run: |
sudo apt-get update
sudo apt-get install -y gcc-multilib g++-multilib
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
mkdir .cargo
printf '[target.aarch64-unknown-linux-gnu]\nlinker = "aarch64-linux-gnu-gcc"' > .cargo/config
- name: Install ARMv7 multilib
if: contains(matrix.target, 'armv7')
run: |
sudo apt-get update
sudo apt-get install -y gcc-multilib g++-multilib
sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
mkdir .cargo
printf '[target.armv7-unknown-linux-gnueabihf]\nlinker = "arm-linux-gnueabihf-gcc"' > .cargo/config
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-08-05
target: ${{ matrix.target }}
components: rustfmt, clippy
default: true
- name: Install WASM target (for runtime building)
run: rustup target add wasm32-unknown-unknown --toolchain nightly-2022-08-05
- name: Build optimized binary
uses: actions-rs/cargo@v1
with:
command: build
args: --release --locked --target ${{ matrix.target }}
- name: Upload build artifacts
uses: actions/upload-artifact@master
with:
name: ${{ matrix.target }}
path: target${{ env.EXE_PATH }}/release/robonomics${{ env.EXE_EXT }}
nixos:
name: NixOS
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v2
with:
submodules: true
- uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-21.11
- name: Build using Nix shell
run: nix-shell --run "cargo build --locked"