forked from TwentyTwoHW/portal-software
-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (109 loc) · 3.88 KB
/
ci.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: "Continuous Integration"
on:
pull_request:
push:
jobs:
host-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Print nixpkgs version
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
- run: nix build .#emulator
- run: nix build .#model
- run: nix build .#gui-simulator
- run: nix build .#sdk
android-bindings:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Print nixpkgs version
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
./target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-android
- run: nix develop .#android --command bash -c "cd sdk/libportal-android && ./gradlew publishToMavenLocal --exclude-task signMavenPublication"
- uses: actions/upload-artifact@v2
with:
name: local-maven
path: ~/.m2/repository/xyz/twenty-two/libportal-android/
ios-bindings:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Print nixpkgs version
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
./target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-ios
- run: nix develop .#ios --command bash -c "cd sdk/libportal-ios && PACKAGE=1 ./build-local-swift.sh"
- uses: actions/upload-artifact@v2
with:
name: portalffi-framework
path: ./sdk/libportal-ios/portalFFI.xcframework.zip
build-firmware:
runs-on: ubuntu-latest
strategy:
matrix:
target: [device, emulator]
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Print nixpkgs version
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
./target
./firmware/target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: nix develop .#embedded --command bash -c "cd firmware && cargo build --no-default-features --features ${{ matrix.target }} --release"
- uses: actions/upload-artifact@v2
with:
name: firmware-${{ matrix.target }}
path: ./firmware/target/thumbv7em-none-eabihf/release/firmware
run-firmware-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
./target
./firmware/target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-fw-test
- run: nix develop .#embedded --command bash -c "cd firmware && cargo build --no-default-features --features emulator,emulator-fast-ticks --profile=emulator-fast-ticks --verbose"
- run: nix develop .#embedded --command bash -c "cargo build --package emulator --no-default-features"
- run: nix develop .#embedded --command bash -c "REPORT_TMP_DIR=/tmp/portal-test-report RUST_LOG=emulator=trace cargo emu-test -- --nocapture --test-threads 1"
timeout-minutes: 10
- uses: actions/upload-artifact@v2
if: always()
with:
name: test-report
path: /tmp/portal-test-report