[macos-runner] Add Gitea Actions workflows for self-hosted macOS CI
Replaces bitrise.yml with equivalent test/beta/release pipelines running on the self-hosted macos-release runner (act_runner inside a dockur/macos VM). Each workflow wakes the VM over SSH before the job and stops it after, since the VM can't be left running 24/7 without starving the VPS's other services.
This commit is contained in:
54
.gitea/workflows/test.yml
Normal file
54
.gitea/workflows/test.yml
Normal file
@@ -0,0 +1,54 @@
|
||||
name: Test (feature branches)
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- "feature/*"
|
||||
|
||||
jobs:
|
||||
wake-macos-vm:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: alpine:3.20
|
||||
steps:
|
||||
- name: Install ssh client
|
||||
run: apk add --no-cache openssh-client
|
||||
- name: Start macOS VM container
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.VPS_SSH_KEY }}" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 \
|
||||
${{ secrets.VPS_SSH_USER }}@${{ secrets.VPS_SSH_HOST }} start
|
||||
|
||||
test:
|
||||
needs: wake-macos-vm
|
||||
runs-on: macos-release
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Run unit tests
|
||||
run: |
|
||||
xcodebuild test \
|
||||
-project Darwin/PediFoods.xcodeproj \
|
||||
-scheme "PediFoods App" \
|
||||
-destination "platform=iOS Simulator,name=iPhone 16,OS=latest"
|
||||
|
||||
sleep-macos-vm:
|
||||
needs: test
|
||||
if: always()
|
||||
runs-on: docker
|
||||
container:
|
||||
image: alpine:3.20
|
||||
steps:
|
||||
- name: Install ssh client
|
||||
run: apk add --no-cache openssh-client
|
||||
- name: Stop macOS VM container
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.VPS_SSH_KEY }}" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 \
|
||||
${{ secrets.VPS_SSH_USER }}@${{ secrets.VPS_SSH_HOST }} stop
|
||||
Reference in New Issue
Block a user