2023-05-24 10:40:52 +03:00
|
|
|
name: macOS Build and Test
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: [opened, synchronize, reopened]
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-09-25 12:19:22 +03:00
|
|
|
name: macOS Build and Test
|
2024-09-03 10:48:14 +03:00
|
|
|
timeout-minutes: 60
|
2024-04-26 18:04:20 +03:00
|
|
|
runs-on: macos-14
|
2024-07-10 10:30:06 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
craft_options: [
|
|
|
|
'--options nextcloud-client.buildFileProviderModule=False',
|
|
|
|
'--options nextcloud-client.buildFileProviderModule=True'
|
|
|
|
]
|
2023-05-24 10:40:52 +03:00
|
|
|
env:
|
2024-04-26 14:47:47 +03:00
|
|
|
CRAFT_TARGET: macos-clang-arm64
|
2023-05-24 10:40:52 +03:00
|
|
|
CRAFT_MASTER_LOCATION: ${{ github.workspace }}/CraftMaster
|
|
|
|
CRAFT_MASTER_CONFIG: ${{ github.workspace }}/craftmaster.ini
|
2024-07-10 10:30:06 +03:00
|
|
|
CRAFT_BLUEPRINT_OPTIONS: ${{ matrix.craft_options }}
|
2023-05-24 10:40:52 +03:00
|
|
|
steps:
|
2023-10-25 12:25:03 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-05-24 10:40:52 +03:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
|
|
|
|
2024-04-26 18:04:20 +03:00
|
|
|
- name: List Xcode installations
|
|
|
|
run: sudo ls -1 /Applications | grep "Xcode"
|
|
|
|
|
|
|
|
- name: Select Xcode 15.3
|
|
|
|
run: sudo xcode-select -s /Applications/Xcode_15.3.app/Contents/Developer
|
|
|
|
|
2023-05-24 10:40:52 +03:00
|
|
|
- name: Restore cache
|
2024-01-23 02:51:53 +03:00
|
|
|
uses: actions/cache@v4
|
2023-05-24 10:40:52 +03:00
|
|
|
with:
|
|
|
|
path: ~/cache
|
|
|
|
key: macos-latest-${{ env.CRAFT_TARGET }}
|
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2023-12-12 02:27:57 +03:00
|
|
|
uses: actions/setup-python@v5
|
2023-05-24 10:40:52 +03:00
|
|
|
with:
|
2024-03-08 11:41:17 +03:00
|
|
|
python-version: 3.12
|
2023-05-24 10:40:52 +03:00
|
|
|
|
|
|
|
- name: Install Homebrew dependencies
|
|
|
|
run: |
|
2024-09-03 17:00:39 +03:00
|
|
|
brew install homebrew/cask/inkscape
|
2023-05-24 10:40:52 +03:00
|
|
|
|
|
|
|
- name: Download Craft
|
|
|
|
run: |
|
|
|
|
git clone -q --depth=1 https://invent.kde.org/packaging/craftmaster.git ${{ env.CRAFT_MASTER_LOCATION }}
|
|
|
|
|
|
|
|
- name: Add Nextcloud client blueprints
|
|
|
|
run: |
|
|
|
|
python "${{ env.CRAFT_MASTER_LOCATION }}/CraftMaster.py" --config "${{ env.CRAFT_MASTER_CONFIG }}" --target ${{ env.CRAFT_TARGET }} -c --add-blueprint-repository https://github.com/nextcloud/desktop-client-blueprints.git
|
|
|
|
|
|
|
|
- name: Setup Craft
|
|
|
|
run: |
|
|
|
|
python "${{ env.CRAFT_MASTER_LOCATION }}/CraftMaster.py" --config "${{ env.CRAFT_MASTER_CONFIG }}" --target ${{ env.CRAFT_TARGET }} -c craft
|
|
|
|
|
|
|
|
- name: Install Craft Nextcloud client dependencies
|
|
|
|
run: |
|
|
|
|
python "${{ env.CRAFT_MASTER_LOCATION }}/CraftMaster.py" --config "${{ env.CRAFT_MASTER_CONFIG }}" --target ${{ env.CRAFT_TARGET }} -c --install-deps nextcloud-client
|
|
|
|
|
2023-05-25 14:10:41 +03:00
|
|
|
- name: Build client
|
2023-05-24 10:40:52 +03:00
|
|
|
run: |
|
2024-09-03 14:48:43 +03:00
|
|
|
python "${{ env.CRAFT_MASTER_LOCATION }}/CraftMaster.py" --config "${{ env.CRAFT_MASTER_CONFIG }}" --target ${{ env.CRAFT_TARGET }} -c --options nextcloud-client.srcDir=${{ github.workspace }} ${{ env.CRAFT_BLUEPRINT_OPTIONS }} nextcloud-client
|
2023-05-25 14:10:41 +03:00
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: |
|
|
|
|
cd ${{ github.workspace }}/${{ env.CRAFT_TARGET }}/build/nextcloud-client/work/build
|
|
|
|
ctest --output-on-failure --output-junit testResult.xml
|
|
|
|
|