-
Notifications
You must be signed in to change notification settings - Fork 0
156 lines (151 loc) · 6.79 KB
/
run.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
on: [push, pull_request]
jobs:
run_pc:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
version: [1.68.0, stable, beta, nightly]
prefix: [pc_run]
fail-fast: false
runs-on: ${{ matrix.os }}
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
RUSTC_FORCE_INCREMENTAL: 1
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/install_rust_by_version
- uses: ./.github/actions/cache_cargo
- name: run windows release
if: matrix.os == 'windows-latest'
run: |
cargo build --release
cargo run --release > ${{ matrix.os }}-${{ matrix.version }}-release-run.log
cargo build
cargo run > ${{ matrix.os }}-${{ matrix.version }}-debug-run.log
working-directory: ./examples/common
- name: run release
if: matrix.os != 'windows-latest'
run: |
cargo build --release
sudo target/release/pc > ${{ matrix.os }}-${{ matrix.version }}-release-run.log
cat ${{ matrix.os }}-${{ matrix.version }}-release-run.log
cargo build
sudo target/debug/pc > ${{ matrix.os }}-${{ matrix.version }}-debug-run.log
cat ${{ matrix.os }}-${{ matrix.version }}-debug-run.log
working-directory: ./examples/common
- name: Upload log release on run
uses: actions/upload-artifact@v3
with:
name: run-log
path: ./examples/common/${{ matrix.os }}-${{ matrix.version }}-release-run.log
- name: Upload log on run
uses: actions/upload-artifact@v3
with:
name: run-log
path: ./examples/common/${{ matrix.os }}-${{ matrix.version }}-debug-run.log
run_android:
strategy:
matrix:
os: [ubuntu-latest]
api-level: [24, 30, 33]
prefix: [android_run]
fail-fast: false
# https://github.com/ReactiveCircus/android-emulator-runner/issues/46#issuecomment-1474555282
# https://github.com/ReactiveCircus/android-emulator-runner/issues/15
runs-on: ${{ matrix.os }}
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
RUSTC_FORCE_INCREMENTAL: 1
steps:
- uses: actions/checkout@v3
- name: install target
# run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android arm-linux-androideabi
run: rustup target add x86_64-linux-android
- uses: cargo-bins/cargo-binstall@main
- name: install rust android
run: cargo binstall -q --no-confirm --force cargo-apk
- name: start android emulator
uses: ReactiveCircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: default
arch: x86_64
profile: pixel_2
emulator-boot-timeout: 900
script: |
adb logcat RustStdoutStderr:D '*:S' > android-${{ matrix.api-level }}-run.log &
bash ../../workflow/android/run.sh
working-directory: ./examples/android/
- run: ls
- name: Upload log on cargo-apk
uses: actions/upload-artifact@v3
with:
name: run-log
path: android-${{ matrix.api-level }}-run.log
# not initialize ndk_context
# run_android_dinghy:
# strategy:
# matrix:
# os: [ubuntu-latest]
# api-level: [24, 30, 33]
# prefix: [android_run]
# fail-fast: false
# # https://github.com/ReactiveCircus/android-emulator-runner/issues/46#issuecomment-1474555282
# # https://github.com/ReactiveCircus/android-emulator-runner/issues/15
# runs-on: ${{ matrix.os }}
# env:
# CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
# RUSTC_FORCE_INCREMENTAL: 1
# steps:
# - uses: actions/checkout@v3
# - name: install target
# # run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android arm-linux-androideabi
# run: rustup target add x86_64-linux-android
# - name: install rust android
# run: cargo install cargo-dinghy --force
# - name: start android emulator
# uses: ReactiveCircus/android-emulator-runner@v2
# with:
# api-level: ${{ matrix.api-level }}
# target: default
# arch: x86_64
# profile: pixel_2
# emulator-boot-timeout: 900
# script: |
# cargo dinghy --platform auto-android-x86_64 build
# cargo dinghy --platform auto-android-x86_64 run > android-dinghy-${{ matrix.api-level }}-run.log
# cargo dinghy --platform auto-android-x86_64 build --release
# cargo dinghy --platform auto-android-x86_64 run --release > android-dinghy-${{ matrix.api-level }}-run.log
# working-directory: ./examples/common/
# - name: Upload log on cargo-apk
# uses: actions/upload-artifact@v3
# with:
# name: run-log
# path: ./examples/common/android-dinghy-${{ matrix.api-level }}-run.log
concat_logs:
runs-on: ubuntu-latest
needs: [run_pc, run_android]
steps:
- name: Download artifacts on run
uses: actions/download-artifact@v3
with:
name: run-log
path: artifacts
- name: Concatenate logs
run: |
directory="artifacts"
echo "" > all-logs.txt
for file in "$directory"/*; do
echo "================ ${file} ================" >> all-logs.txt
cat "$file" >> all-logs.txt
done
- name: Upload concatenated log
uses: actions/upload-artifact@v3
with:
name: run-log
path: all-logs.txt
# https://zenn.dev/takeyaqa/articles/github-actions-appium-android-emulator
# https://stackoverflow.com/questions/3152681/android-emulator-5554-offline
# https://github.com/kiwix/kiwix-android/blob/develop/.github/workflows/ci.yml