-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (63 loc) · 2.4 KB
/
build-and-test.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
name: gh.build-and-test
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: build
run: cargo build
- name: test
run: cargo test
dist:
runs-on: ubuntu-latest
container:
image: rust:1.61.0
env:
TWOWAIYO_VERSION: "${{ github.sha }}"
steps:
- uses: actions/checkout@v2
- name: Update apt
run: apt-get update
- name: Install packages
run: apt-get install -y libssl-dev postgresql-client libpq-dev gcc-arm-linux-gnueabihf nodejs npm
- name: Download openssl
run: cd /tmp && wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz
- name: Extract openssl
run: cd /tmp && tar xzf openssl-1.1.1g.tar.gz
- name: Configure openssl
run: cd /tmp/openssl-1.1.1g && ./config shared
env:
MACHINE: armv7
ARCH: arm
CC: arm-linux-gnueabihf-gcc
- name: Build openssl
run: cd /tmp/openssl-1.1.1g && make
env:
MACHINE: armv7
ARCH: arm
CC: arm-linux-gnueabihf-gcc
- name: Add target
run: rustup target add armv7-unknown-linux-gnueabihf
- name: Add target components
run: rustup component add --target armv7-unknown-linux-gnueabihf rust-src rust-std rustc-dev
- name: Build w/ target
run: cargo build --target armv7-unknown-linux-gnueabihf --release
env:
OPENSSL_LIB_DIR: /tmp/openssl-1.1.1g/
OPENSSL_INCLUDE_DIR: /tmp/openssl-1.1.1g/include
- name: Prepare distributable directory
run: mkdir -p target/dist/twowaiyo
- name: Populate distributable (twowaiyo)
run: cp target/armv7-unknown-linux-gnueabihf/release/twowaiyo target/dist/twowaiyo/twowaiyo
- name: Populate distributable (stickbot)
run: cp target/armv7-unknown-linux-gnueabihf/release/stickbot target/dist/twowaiyo/stickbot
- name: Populate distributable (boxbot)
run: cp target/armv7-unknown-linux-gnueabihf/release/boxbot target/dist/twowaiyo/boxbot
- name: Compress distributable
run: tar cvzf ./twowaiyo-armv7-unknown-linux-gnueabihf-$GITHUB_SHA.tar.gz -C target/dist twowaiyo
- name: Create Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: "./twowaiyo-armv7-unknown-linux-gnueabihf-${{ github.sha }}.tar.gz"