Skip to content

Add test-integration job #8

Add test-integration job

Add test-integration job #8

Workflow file for this run

name: CI
on:
push:
branches: [master]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
versions:
name: List versions
runs-on: macos-latest
steps:
- uses: actions/checkout@v3.5.3
- id: python
run: |
cd target
echo default=$(./list-versions.py --default)
for mode in short long; do
echo "$mode<<EOF"
./list-versions.py --$mode
echo EOF
done >> $GITHUB_OUTPUT
- id: agp
run: |
cd product/gradle-plugin/src/test/integration/data
(
echo -n versions=
echo base-* | sed 's/base-//g' | jq -cR 'split(" ")'
) >> $GITHUB_OUTPUT
outputs:
python-default: ${{ steps.python.outputs.default }}
python-short: ${{ steps.python.outputs.short }}
python-long: ${{ steps.python.outputs.long }}
agp: ${{ steps.agp.outputs.versions }}
build-product:
needs: versions
runs-on: macos-latest
steps:
- uses: actions/checkout@v3.5.3
- uses: actions/setup-python@v4.6.1
with:
python-version: ${{ needs.versions.outputs.python-short }}
# This step uses a self-contained script rather than needs.versions,
# because it's referenced from product/README.md.
- name: Download Android Python builds
run: |
cd target
for version in $(./list-versions.py --long); do
target_dir=../maven/com/chaquo/python/target/$version
./download-target.sh $target_dir
./unpackage-target.sh prefix $target_dir
done
- name: Install Python requirements
run: pip install -r product/runtime/requirements-build.txt
# TODO: move versions to a single location used by both CI and
# runtime/build.gradle. COMPILE_SDK_VERSION can then be removed from Common.java,
# since it's not used anywhere else.
- name: Set up Android SDK
run: |
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager \
'cmake;3.22.1' 'ndk;22.1.7171670' 'platforms;android-30'
- uses: ./.github/actions/create-local-properties
- name: Build
run: |
cd product
./gradlew publish
- name: Upload Maven repository
uses: actions/upload-artifact@v3.1.2
with:
name: maven
path: maven
if-no-files-found: error
test-integration:
needs: [versions, build-product]
strategy:
fail-fast: false
matrix:
os: [macos, ubuntu, windows]
agp-version: ${{ fromJSON(needs.versions.outputs.agp) }}
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v3.5.3
- uses: actions/setup-python@v4.6.1
with:
python-version: ${{ needs.versions.outputs.python-short }}
- name: Download Maven repository
uses: actions/download-artifact@v3.0.2
with:
name: maven
path: maven
- name: Install Python requirements
run: |
python${{ needs.versions.outputs.python-default }} -m \
pip install -r gradle-plugin/src/test/integration/requirements.txt
- uses: ./.github/actions/create-local-properties
- name: Test
run: |
cd product
./gradlew testIntegration-${{ matrix.agp-version }}