Skip to content

build

build #20

Workflow file for this run

name: build
on:
workflow_dispatch: {}
push:
branches:
- jbion/github-build
jobs:
test-standard:
strategy:
fail-fast: false # So that all jobs run to completion even when one fails
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
name: Standard tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Setup Amper caches
uses: ./.github/actions/setup-amper
- name: Setup test caches
uses: ./.github/actions/test-caches
- name: Create local.properties with empty credentials
shell: bash
run: |
echo "space.username=" >> local.properties
echo "space.password=" >> local.properties
- name: Run regular tests
run: ./amper test --exclude-module=amper-mobile-test --exclude-module=amper-cli-test
- name: Run CLI tests
run: ./amper test --include-module=amper-cli-test
- name: Report Amper logs
uses: actions/upload-artifact@v7
if: ${{ !cancelled() }} # run this step even if the previous step failed
with:
name: build-logs-${{ runner.os }}
path: build/logs/**
archive: true
# In amper-cli-test, we start child Amper CLI processes we publish their logs as attachments of JUnit reports
- name: Report JUnit attachments
uses: actions/upload-artifact@v7
if: ${{ !cancelled() }} # run this step even if the previous step failed
with:
name: junit-attachments-${{ runner.os }}
path: build/reports/*/jvm/junit-jupiter
archive: true
retention-days: 15
- name: Report test results
uses: ./.github/actions/report-tests
if: ${{ !cancelled() }} # run this step even if the previous step failed
test-mobile:
strategy:
fail-fast: false # So that all jobs run to completion even when one fails
matrix:
include:
- description: Android examples
testArgs: "--include-classes=RunAndroidExamplesOnEmulatorsTestsStandalone"
os: ubuntu-latest
- description: iOS examples
testArgs: "--include-classes=RuniOSExamplesOnEmulatorsTestsStandalone"
os: macos-latest
# FIXME external projects require git credentials - maybe they should just be in our examples...
# - description: Android external projects
# testArgs: "--include-classes=RunAndroidExternalProjectsStandalone"
# os: ubuntu-latest
# - description: iOS external projects
# testArgs: "--include-classes=RuniOSExternalProjectsStandalone"
# os: macos-latest
name: Mobile tests (${{ matrix.description }})
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Setup Amper caches
uses: ./.github/actions/setup-amper
- name: Setup test caches
uses: ./.github/actions/test-caches
- name: Create local.properties with empty credentials
shell: bash
run: |
echo "space.username=" >> local.properties
echo "space.password=" >> local.properties
- name: Enable KVM group perms
if: ${{ runner.os == 'Linux' }} # needed for Android emulator
# See https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Run mobile tests
run: ./amper test -m amper-mobile-test ${{ matrix.testArgs }}
- name: Report Amper logs
uses: actions/upload-artifact@v7
if: ${{ !cancelled() }} # run this step even if the previous step failed
with:
name: build-logs-mobile-${{ matrix.description }}
path: build/logs/**
archive: true
- name: Report test results
uses: ./.github/actions/report-tests
if: ${{ !cancelled() }} # run this step even if previous step failed