Skip to content

Commit

Permalink
update CI to use inputs.profile
Browse files Browse the repository at this point in the history
  • Loading branch information
mukilan committed Dec 3, 2023
1 parent 0ace1c2 commit 848f2ed
Showing 1 changed file with 18 additions and 42 deletions.
60 changes: 18 additions & 42 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,25 @@ name: Android
on:
workflow_call:
inputs:
production:
required: false
default: false
type: boolean
unit-tests:
required: false
default: false
type: boolean
upload:
required: false
default: false
type: boolean
github-release-id:
profile:
required: false
default: "release"
type: string
workflow_dispatch:
inputs:
production:
profile:
required: false
default: false
type: boolean
unit-tests:
required: false
default: false
type: boolean
upload:
required: false
default: false
type: boolean
default: "release"
type: string
options: ["release", "debug", "production"]
push:
branches: ["try-android"]

env:
cargo_profile_option: ${{ inputs.production && '--profile production' || '--release' }}
cargo_profile_name: ${{ inputs.production && 'production' || 'release' }}
RUST_BACKTRACE: 1
SHELL: /bin/bash
SCCACHE_GHA_ENABLED: "true"
CCACHE: "sccache"
CARGO_INCREMENTAL: 0

jobs:
Expand All @@ -60,6 +42,8 @@ jobs:
with:
ref: refs/pull/${{ github.event.issue.number || github.event.number }}/head
fetch-depth: 2
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install taplo
uses: baptiste0928/cargo-install@v2
with:
Expand All @@ -69,36 +53,28 @@ jobs:
run: python3 -m pip install --upgrade pip virtualenv
- name: Bootstrap dependencies
run: sudo apt update && python3 ./mach bootstrap
# - name: Tidy
# run: python3 ./mach test-tidy --no-progress --all
- name: Set LIBCLANG_PATH env # needed for bindgen in mozangle
run: echo "LIBCLANG_PATH=/usr/lib/llvm-14/lib" >> $GITHUB_ENV
- name: Release build (${{ matrix.arch }} ${{ inputs.production && 'without' || 'with' }} debug assertions)
- name: Build (arch ${{ matrix.arch }} profile ${{ inputs.profile }})
run: |
export JAVA_HOME="${JAVA_HOME_17_X64}"
python3 ./mach build --android --target ${{ matrix.arch }} ${cargo_profile_option}
# - name: Smoketest
# run: xvfb-run python3 ./mach smoketest ${cargo_profile_option}
- name: Script tests
run: ./mach test-scripts
# - name: Unit tests
# if: ${{ inputs.unit-tests || github.ref_name == 'try-linux' }}
# run: python3 ./mach test-unit --android ${cargo_profile_option}
python3 ./mach build --android --target ${{ matrix.arch }} --${{ inputs.profile }}
# TODO: fix test-android-startup
# - name: Script tests
# run: ./mach test-android-startup
- name: Rename build timing
run: cp -r target/cargo-timings target/cargo-timings-android
run: cp -r target/cargo-timings target/cargo-timings-android-${{ matrix.arch }}
- name: Archive build timing
uses: actions/upload-artifact@v3
with:
name: cargo-timings
# Using a wildcard here ensures that the archive includes the path.
path: target/cargo-timings-*
# - name: Lockfile check
# run: ./etc/ci/lockfile_changed.sh
- name: Upload APK artifact for mach package
uses: actions/upload-artifact@v3
with:
name: android-${{ matrix.arch }}-${{ env.cargo_profile_name }}
path: target/android/${{ matrix.arch }}/${{ env.cargo_profile_name }}/servoapp.apk
name: android-${{ matrix.arch }}-${{ inputs.profile }}
path: target/android/${{ matrix.arch }}/${{ inputs.profile }}/servoapp.apk

result:
name: Result
Expand Down

0 comments on commit 848f2ed

Please sign in to comment.