forked from ankidroid/Anki-Android-Backend
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (60 loc) · 2.23 KB
/
linux_build.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
name: rsdroid (Linux)
on:
push:
schedule:
- cron: "0 0 * * *"
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
timeout-minutes: 80
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Fetch submodules
run: git submodule update --init --recursive --remote --force
- name: Configure JDK 1.11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "11" # minimum for Android API31
- name: Install Android Command Line Tools
uses: android-actions/setup-android@v2
# COULD_BE_BETTER: Consider turning this into a GitHub action - help the wider community
# NDK install (unzipping) is really noisy - silence the log spam with grep, while keeping errors
- name: Install NDK (silent)
run: .github/scripts/install_ndk.sh 22.0.7026061
- name: Install linker
run: .github/scripts/linux_install_x86_64-unknown-linux-gnu-gcc.sh
# install cargo
- name: Install Rust
uses: actions-rs/[email protected]
with:
toolchain: 1.54.0
override: true
components: rustfmt
# actions-rs only accepts "target" (although a "targets" param to be added in v2). We need 7 targets.
- name: Install Rust Targets
run: .github/scripts/install_rust_targets.sh
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Rust Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
rslib-bridge/target
key: ${{ runner.os }}-rust-v1-assembleRelease-${{ hashFiles('rslib-bridge/**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-rust-v1-assembleRelease
${{ runner.os }}-rust-v1
- name: Build
run: ./gradlew clean assembleRelease -DtestBuildType=release -Dorg.gradle.daemon=false -Dorg.gradle.console=plain # assembleAndroidTest
# Our publish workflow (publish_library.yaml) is on Ubuntu and needs javadocs (#57)
- name: Test Javadoc
run: ./gradlew :rsdroid:androidJavadocs -DtestBuildType=release -Dorg.gradle.daemon=false -Dorg.gradle.console=plain