Skip to content

chore: sync upstream PR #7803 - fix(android): Subsequent build crash with missing version data #2

chore: sync upstream PR #7803 - fix(android): Subsequent build crash with missing version data

chore: sync upstream PR #7803 - fix(android): Subsequent build crash with missing version data #2

Workflow file for this run

name: Build source code and test it
on:
push:
branches:
- renovate/**
pull_request:
branches: [main, plus]
workflow_call:
jobs:
guard_swiftpm_version:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v6
- name: Enforce capacitor-swift-pm version
run: |
set -euo pipefail
if ! grep -Eq 'https://github.com/ionic-team/capacitor-swift-pm\.git"[[:space:]]*,[[:space:]]*from:[[:space:]]*"8\.0\.0"' Package.swift; then
echo "Expected capacitor-swift-pm to be pinned to 8.0.0 in Package.swift"
exit 1
fi
setup:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Get Latest
uses: actions/setup-node@v6
with:
node-version: 22.x
- uses: actions/checkout@v5
- name: Restore Dependency Cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.OS }}-dependencies-cache-${{ hashFiles('**/package.json') }}
lint:
runs-on: macos-15
timeout-minutes: 30
steps:
- uses: actions/setup-node@v6
with:
node-version: 22.x
- uses: actions/checkout@v5
- name: Restore Dependency Cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.OS }}-dependencies-cache-${{ hashFiles('**/package.json') }}
- run: npm install
- run: brew install swiftlint
- run: npm run lint
test-cli:
runs-on: macos-15
timeout-minutes: 30
needs:
- setup
- lint
steps:
- uses: actions/setup-node@v6
with:
node-version: 22.x
- uses: actions/checkout@v5
- name: Restore Dependency Cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.OS }}-dependencies-cache-${{ hashFiles('**/package.json') }}
- run: npm install
- run: npm run build
working-directory: ./cli
- run: npm test
working-directory: ./cli
test-core:
runs-on: ubuntu-latest
timeout-minutes: 30
needs:
- setup
- lint
steps:
- uses: actions/setup-node@v6
with:
node-version: 22.x
- uses: actions/checkout@v5
- name: Restore Dependency Cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.OS }}-dependencies-cache-${{ hashFiles('**/package.json') }}
- run: npm install
- run: npm run build
working-directory: ./core
- run: npm test
working-directory: ./core
test-ios:
runs-on: macos-15
timeout-minutes: 30
needs:
- setup
- lint
strategy:
matrix:
xcode:
- /Applications/Xcode_26.0.app
steps:
- run: sudo xcode-select --switch ${{ matrix.xcode }}
- uses: actions/setup-node@v6
with:
node-version: 22.x
- uses: actions/checkout@v5
- name: Restore Dependency Cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.OS }}-dependencies-cache-${{ hashFiles('**/package.json') }}
- run: npm install
- run: npm run verify
working-directory: ./ios
- name: Validate native podspec
run: sh ./scripts/native-podspec.sh lint
test-android:
runs-on: ubuntu-latest
timeout-minutes: 30
needs:
- setup
- lint
steps:
- uses: actions/setup-node@v6
with:
node-version: 22.x
- name: set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'zulu'
- uses: actions/checkout@v5
- name: Restore Dependency Cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.OS }}-dependencies-cache-${{ hashFiles('**/package.json') }}
- run: npm install
- run: npm run verify
working-directory: ./android