clean module.update_prop (#78) #227
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: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build: | |
name: Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Ninja | |
shell: bash | |
run: | | |
set -x | |
sudo apt install ninja-build | |
- name: Setup environement variables | |
shell: bash | |
run: | | |
set -x | |
echo "android=$(realpath ${{ github.workspace }}/../android)" >> $GITHUB_ENV | |
echo "key=$(git log -1 --format='%h' tests/*/checkout.sh tests/*/gen-ninja.sh)" >> $GITHUB_ENV | |
echo "tmp_dir=$(realpath ${{ github.workspace }}/../tmp)" >> $GITHUB_ENV | |
- name: Get repositories from cache | |
id: checkout-repositories | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.tmp_dir }} | |
key: ${{ env.key }} | |
- name: Tests w/o cache | |
if: steps.checkout-repositories.outputs.cache-hit != 'true' | |
shell: bash | |
env: | |
N2S_TMP_PATH: ${{ env.tmp_dir }} | |
N2S_NDK_PATH: ${{ env.android }} | |
run: | | |
set -x | |
mkdir -p "${{ env.android }}" | |
for repo in tests/* | |
do | |
bash "${repo}/checkout.sh" "${{ env.android }}" | |
done | |
PATH="${{ env.android }}/depot_tools:${PATH}" cargo run --release -- --skip-build --aosp-path "${{ env.android }}" | |
- name: Tests w/ cache | |
if: steps.checkout-repositories.outputs.cache-hit == 'true' | |
shell: bash | |
env: | |
N2S_TMP_PATH: ${{ env.tmp_dir }} | |
N2S_NDK_PATH: ${{ env.android }} | |
run: | | |
set -x | |
mkdir -p "${{ env.android }}" | |
PATH="${{ env.android }}/depot_tools:${PATH}" cargo run --release -- --skip-gen-ninja --aosp-path "${{ env.android }}" | |
- name: Check generated files | |
shell: bash | |
run: | | |
set -x | |
git diff --exit-code | |
- name: Check format | |
shell: bash | |
run: | | |
set -x | |
find -name *.rs -exec rustfmt {} \+ | |
git diff --exit-code |