-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (50 loc) · 1.57 KB
/
presubmit.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
name: Presubmit
on:
push:
pull_request:
jobs:
build:
name: Generate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Ninja
uses: ./.github/actions/setup-ninja
- name: Checkout repos
shell: bash
run: |
set -x
echo "android=${{ github.workspace }}/android" >> $GITHUB_ENV
mkdir -p ${{ env.android }}/external
for repo in tests/*
do
name=$(basename ${repo})
git init ${{ env.android }}/external/${name}
git -C ${{ env.android }}/external/${name} remote add origin $(cat ${repo}/REPO)
git -C ${{ env.android }}/external/${name} fetch --depth 1 origin $(cat ${repo}/VERSION)
git -C ${{ env.android }}/external/${name} checkout $(cat ${repo}/VERSION)
done
- name: Download NDK
shell: bash
run: |
set -x
echo "ndk=android-ndk-r27c" >> $GITHUB_ENV
ndk_zip=${{ env.ndk }}-linux.zip
wget https://dl.google.com/android/repository/${ndk_zip}
unzip -q ${ndk_zip}
- name: Run ninja-to-soong
shell: bash
run: |
set -x
cargo run -- $(realpath ${{ env.android }}) $(realpath $(pwd)/${{ env.ndk }}) all
- name: Check generated files
shell: bash
run: |
set -x
for repo in tests/*
do
name=$(basename ${repo})
diff ${repo}/Android.bp ${{ env.android }}/external/${name}/Android.bp
done