split CI is several stages #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |