Skip to content

Commit

Permalink
Add more ci scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
waliid committed Nov 8, 2024
1 parent 1d71f90 commit ff9e50c
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 26 deletions.
31 changes: 12 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ jobs:

- name: Run the quality check
run: |
${{ env.ci_scripts_path }}/run-vm-shell-command.sh \
${{ env.vm_name }} "cd ~/_repo && make check-quality"
${{ env.ci_scripts_path }}/vm-check-quality.sh \
${{ env.scripts_path }} ${{ env.vm_name }}
resolve-spm-dependencies:
needs: [install-tools, run-streams, setup-project]
Expand All @@ -86,9 +86,8 @@ jobs:

- name: Resolve SPM dependencies
run: |
${{ env.ci_scripts_path }}/run-vm-shell-command.sh \
${{ env.vm_name }} \
"cd ~/_repo && xcodebuild -resolvePackageDependencies -verbose"
${{ env.ci_scripts_path }}/vm-resolve-spm-dependencies.sh \
${{ env.scripts_path }} ${{ env.vm_name }}
test-ios:
needs: [install-tools, resolve-spm-dependencies]
Expand All @@ -99,9 +98,8 @@ jobs:

- name: Run the iOS tests
run: |
${{ env.ci_scripts_path }}/run-vm-shell-command.sh \
${{ env.vm_name }} \
"cd ~/_repo && make test-ios"
${{ env.ci_scripts_path }}/vm-test.sh \
${{ env.scripts_path }} ${{ env.vm_name }} "ios"
test-tvos:
needs: [install-tools, resolve-spm-dependencies]
Expand All @@ -112,9 +110,8 @@ jobs:

- name: Run the tvOS tests
run: |
${{ env.ci_scripts_path }}/run-vm-shell-command.sh \
${{ env.vm_name }} \
"cd ~/_repo && make test-tvos"
${{ env.ci_scripts_path }}/vm-test.sh \
${{ env.scripts_path }} ${{ env.vm_name }} "tvos"
archive-demo-ios:
needs: [install-tools, test-ios, test-tvos]
Expand All @@ -125,10 +122,8 @@ jobs:

- name: Archive the iOS demo
run: |
${{ env.ci_scripts_path }}/run-vm-shell-command.sh \
${{ env.vm_name }} \
"cd ~/_repo && security unlock-keychain -p 'admin' \
~/Library/Keychains/login.keychain-db && make archive-demo-ios"
${{ env.ci_scripts_path }}/vm-test.sh \
${{ env.scripts_path }} ${{ env.vm_name }} "ios"
archive-demo-tvos:
needs: [install-tools, test-ios, test-tvos]
Expand All @@ -139,10 +134,8 @@ jobs:

- name: Archive the tvOS demo
run: |
${{ env.ci_scripts_path }}/run-vm-shell-command.sh \
${{ env.vm_name }} \
"cd ~/_repo && security unlock-keychain -p 'admin' \
~/Library/Keychains/login.keychain-db && make archive-demo-tvos"
${{ env.ci_scripts_path }}/vm-test.sh \
${{ env.scripts_path }} ${{ env.vm_name }} "tvos"
clean:
needs: [install-tools, archive-demo-ios, archive-demo-tvos]
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/scripts/setup-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,18 @@ then
exit 1
fi

echo "==> $(pwd) <=="
source ./unlock-keychain.sh

repository_path="~/_repo"
keychain_password="admin"
keychain_path="~/Library/Keychains/login.keychain-db"
certificate_path="$repository_path/Configuration/6YXTQTG8JJ_development.p12"
certificate_password="6YXTQTG8JJ"

configuration_repo="github.com/SRGSSR/pillarbox-apple-configuration.git"
configuration_dir_path="$repository_path/Configuration"
configuration_script="$repository_path/Scripts/checkout-configuration.sh"
configuration_branch="certificate"
configuration_commit="HEAD"

function unlock_keychain {
security unlock-keychain -p $keychain_password $keychain_path
}

function import_certificate {
security import $certificate_path -k $keychain_path -P $certificate_password -T /usr/bin/security -T /usr/bin/codesign
}
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/scripts/unlock-keychain.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

keychain_password="admin"
keychain_path="~/Library/Keychains/login.keychain-db"

function unlock_keychain {
security unlock-keychain -p $keychain_password $keychain_path
}
17 changes: 17 additions & 0 deletions .github/workflows/scripts/vm-archive.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

scripts_path="$1"
vm_name="$2"
platform="$3"

repository_path="~/_repo"

if [[ -z $scripts_path || -z $vm_name || -z $platform ]]
then
echo "[!] Usage: $(echo $0) <scripts_path> <vm_name> <platform>"
exit 1
fi

source ./unlock-keychain.sh

$scripts_path/run-vm-shell-command.sh $vm_name "cd $repository_path && echo $(unlock_keychain) && make archive-demo-$platform"
14 changes: 14 additions & 0 deletions .github/workflows/scripts/vm-check-quality.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

scripts_path="$1"
vm_name="$2"

repository_path="~/_repo"

if [[ -z $scripts_path || -z $vm_name ]]
then
echo "[!] Usage: $(echo $0) <scripts_path> <vm_name>"
exit 1
fi

$scripts_path/run-vm-shell-command.sh $vm_name "cd $repository_path && make check-quality"
12 changes: 12 additions & 0 deletions .github/workflows/scripts/vm-resolve-spm-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
scripts_path="$1"
vm_name="$2"

repository_path="~/_repo"

if [[ -z $scripts_path || -z $vm_name ]]
then
echo "[!] Usage: $(echo $0) <scripts_path> <vm_name>"
exit 1
fi

$scripts_path/run-vm-shell-command.sh $vm_name "cd $repository_path && xcodebuild -resolvePackageDependencies -verbose"
15 changes: 15 additions & 0 deletions .github/workflows/scripts/vm-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

scripts_path="$1"
vm_name="$2"
platform="$3"

repository_path="~/_repo"

if [[ -z $scripts_path || -z $vm_name || -z $platform ]]
then
echo "[!] Usage: $(echo $0) <scripts_path> <vm_name> <platform>"
exit 1
fi

$scripts_path/run-vm-shell-command.sh $vm_name "cd $repository_path && make test-$platform"

0 comments on commit ff9e50c

Please sign in to comment.