Skip to content

Commit

Permalink
[Issue-1753] Optimize build time
Browse files Browse the repository at this point in the history
  • Loading branch information
dominhquang committed Sep 13, 2024
1 parent c3fdd5d commit 333036d
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/build-internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,26 @@ on:
branches: [ "koni-dev", "upgrade-ui" ]

jobs:
check-runner:
runs-on: macos-13
outputs:
runner-label: ${{ steps.set-runner.outputs.runner-label }}

steps:
- name: Set runner
id: set-runner
run: |
runners=$(curl -s -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ secrets.REPO_ACCESS_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/actions/runners")
available=$(echo "$runners" | jq '.runners[] | select(.status == "online" and .busy == false and .labels[] .name == "self-hosted")')
if [ -n "$available" ]; then
echo "runner-label=self-hosted" >> $GITHUB_OUTPUT
else
echo "runner-label=macos-13" >> $GITHUB_OUTPUT
fi
# iOS build workflow -------------------------------------------------
build-ios:
name: iOS builds
runs-on:
- labels: [self-hosted]
timeout-minutes: 0
- labels: [macos-13]
timeout-minutes: 10
runs-on: ${{ needs.check-runner.outputs.runner-label }}
env:
GH_PAT: ${{ secrets.GH_PAT }}
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }}
Expand Down

0 comments on commit 333036d

Please sign in to comment.