Skip to content

Commit

Permalink
Runner info
Browse files Browse the repository at this point in the history
  • Loading branch information
waliid committed Nov 1, 2024
1 parent 87c0e70 commit 33cc1d4
Showing 1 changed file with 106 additions and 97 deletions.
203 changes: 106 additions & 97 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,117 +6,126 @@ env:
vm_name: sequoia-for-pillarbox
vm_image: ghcr.io/cirruslabs/macos-sequoia-xcode:latest
jobs:
install-tools:
runner-info:
runs-on:
labels: [tart, macos]
steps:
- name: Clone macos-ci-setup repository
- name: Get runner info
run: |
rm -rf ~/macos-ci-setup
git clone -b add-scripts https://${{ env.macos_ci_setup_token }}@github.com/SRGSSR/macos-ci-setup.git ~/macos-ci-setup
- name: Install tools
run: |
cd ~/macos-ci-setup
./brew-fetch.sh ${{ env.vm_name }} "mint shellcheck markdownlint-cli yamllint ffmpeg"
./create-vm-for-project.sh ${{ env.vm_name }} ${{ env.vm_image }}
./clone-repo-in-vm.sh ${{ env.vm_name }} ${{ github.ref_name }} "https://${{ env.macos_ci_setup_token }}@github.com/${{ github.repository }}.git"
./run-vm-shell-command.sh ${{ env.vm_name }} "brew install --quiet mint shellcheck markdownlint-cli yamllint ffmpeg"
./run-vm-shell-command.sh ${{ env.vm_name }} "rbenv install --skip-existing 3.3.5"
./run-vm-shell-command.sh ${{ env.vm_name }} "echo 'export PATH=\"$HOME/.rbenv/bin:$PATH\"' >> ~/.zshrc"
./run-vm-shell-command.sh ${{ env.vm_name }} "rbenv init - >> ~/.zshrc"
./run-vm-shell-command.sh ${{ env.vm_name }} "rbenv global 3.3.5"
./run-vm-shell-command.sh ${{ env.vm_name }} "sudo gem install bundler -v 2.5.22"
./run-vm-shell-command.sh ${{ env.vm_name }} "curl --location https://github.com/shaka-project/shaka-packager/releases/download/v3.2.0/packager-osx-arm64 -o /opt/homebrew/bin/shaka-packager"
./run-vm-shell-command.sh ${{ env.vm_name }} "chmod a+x /opt/homebrew/bin/shaka-packager"
./run-vm-shell-command.sh ${{ env.vm_name }} "source ~/.zshrc"
echo "{runner_name}={$RUNNER_NAME}" >> "$GITHUB_ENV"
echo "==> ${{ env.runner_name }}"
# install-tools:
# runs-on:
# labels: [tart, macos]
# steps:
# - name: Clone macos-ci-setup repository
# run: |
# rm -rf ~/macos-ci-setup
# git clone -b add-scripts https://${{ env.macos_ci_setup_token }}@github.com/SRGSSR/macos-ci-setup.git ~/macos-ci-setup
# - name: Install tools
# run: |
# cd ~/macos-ci-setup
# ./brew-fetch.sh ${{ env.vm_name }} "mint shellcheck markdownlint-cli yamllint ffmpeg"
# ./create-vm-for-project.sh ${{ env.vm_name }} ${{ env.vm_image }}
# ./clone-repo-in-vm.sh ${{ env.vm_name }} ${{ github.ref_name }} "https://${{ env.macos_ci_setup_token }}@github.com/${{ github.repository }}.git"
# ./run-vm-shell-command.sh ${{ env.vm_name }} "brew install --quiet mint shellcheck markdownlint-cli yamllint ffmpeg"
# ./run-vm-shell-command.sh ${{ env.vm_name }} "rbenv install --skip-existing 3.3.5"
# ./run-vm-shell-command.sh ${{ env.vm_name }} "echo 'export PATH=\"$HOME/.rbenv/bin:$PATH\"' >> ~/.zshrc"
# ./run-vm-shell-command.sh ${{ env.vm_name }} "rbenv init - >> ~/.zshrc"
# ./run-vm-shell-command.sh ${{ env.vm_name }} "rbenv global 3.3.5"
# ./run-vm-shell-command.sh ${{ env.vm_name }} "sudo gem install bundler -v 2.5.22"
# ./run-vm-shell-command.sh ${{ env.vm_name }} "curl --location https://github.com/shaka-project/shaka-packager/releases/download/v3.2.0/packager-osx-arm64 -o /opt/homebrew/bin/shaka-packager"
# ./run-vm-shell-command.sh ${{ env.vm_name }} "chmod a+x /opt/homebrew/bin/shaka-packager"
# ./run-vm-shell-command.sh ${{ env.vm_name }} "source ~/.zshrc"

setup-project:
needs: install-tools
runs-on:
labels: [tart, macos]
steps:
- name: Setup project
run: |
cd ~/macos-ci-setup
./run-vm-shell-command.sh ${{ env.vm_name }} "cd ~/_repo && rm -rf Configuration"
./run-vm-shell-command.sh ${{ env.vm_name }} "cd ~/_repo && Scripts/checkout-configuration.sh https://${{ env.macos_ci_setup_token }}@github.com/SRGSSR/pillarbox-apple-configuration.git certificate HEAD Configuration"
./run-vm-shell-command.sh ${{ env.vm_name }} "security unlock-keychain -p 'admin' ~/Library/Keychains/login.keychain-db && security import ~/_repo/Configuration/6YXTQTG8JJ_development.p12 -k ~/Library/Keychains/login.keychain-db -P '6YXTQTG8JJ' -T /usr/bin/security -T /usr/bin/codesign"
./run-vm-shell-command.sh ${{ env.vm_name }} "security set-key-partition-list -S apple-tool:,apple: -s -k 'admin' ~/Library/Keychains/login.keychain-db"
./run-vm-shell-command.sh ${{ env.vm_name }} "cd ~/_repo && make setup"
# setup-project:
# needs: install-tools
# runs-on:
# labels: [tart, macos]
# steps:
# - name: Setup project
# run: |
# cd ~/macos-ci-setup
# ./run-vm-shell-command.sh ${{ env.vm_name }} "cd ~/_repo && rm -rf Configuration"
# ./run-vm-shell-command.sh ${{ env.vm_name }} "cd ~/_repo && Scripts/checkout-configuration.sh https://${{ env.macos_ci_setup_token }}@github.com/SRGSSR/pillarbox-apple-configuration.git certificate HEAD Configuration"
# ./run-vm-shell-command.sh ${{ env.vm_name }} "security unlock-keychain -p 'admin' ~/Library/Keychains/login.keychain-db && security import ~/_repo/Configuration/6YXTQTG8JJ_development.p12 -k ~/Library/Keychains/login.keychain-db -P '6YXTQTG8JJ' -T /usr/bin/security -T /usr/bin/codesign"
# ./run-vm-shell-command.sh ${{ env.vm_name }} "security set-key-partition-list -S apple-tool:,apple: -s -k 'admin' ~/Library/Keychains/login.keychain-db"
# ./run-vm-shell-command.sh ${{ env.vm_name }} "cd ~/_repo && make setup"

cache-management:
needs: install-tools
runs-on:
labels: [tart, macos]
steps:
- name: Setup project
run: |
cd ~/macos-ci-setup
./restore-vm-caches.sh ${{ env.vm_name }}
# cache-management:
# needs: install-tools
# runs-on:
# labels: [tart, macos]
# steps:
# - name: Setup project
# run: |
# cd ~/macos-ci-setup
# ./restore-vm-caches.sh ${{ env.vm_name }}


# check-quality:
# needs: setup-project
# # check-quality:
# # needs: setup-project
# # runs-on:
# # labels: [tart, macos]
# # steps:
# # - name: Run the quality check
# # run: |
# # ~/macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} "cd ~/_repo && make check-quality"

# run-streams:
# needs: install-tools
# runs-on:
# labels: [tart, macos]
# steps:
# - name: Run the quality check
# - name: Run test streams
# run: |
# ~/macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} "cd ~/_repo && make check-quality"
# ~/macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} "cd ~/_repo && make test-streams-start"

run-streams:
needs: install-tools
runs-on:
labels: [tart, macos]
steps:
- name: Run test streams
run: |
~/macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} "cd ~/_repo && make test-streams-start"
test-ios:
needs: [run-streams, setup-project, cache-management]
runs-on:
labels: [tart, macos]
steps:
- name: Run the iOS tests
run: |
~/macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} "cd ~/_repo && make test-ios"
# test-ios:
# needs: [run-streams, setup-project, cache-management]
# runs-on:
# labels: [tart, macos]
# steps:
# - name: Run the iOS tests
# run: |
# ~/macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} "cd ~/_repo && make test-ios"

test-tvos:
needs: [run-streams, setup-project, cache-management]
runs-on:
labels: [tart, macos]
steps:
- name: Run the tvOS tests
run: |
~/macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} "cd ~/_repo && make test-tvos"
# test-tvos:
# needs: [run-streams, setup-project, cache-management]
# runs-on:
# labels: [tart, macos]
# steps:
# - name: Run the tvOS tests
# run: |
# ~/macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} "cd ~/_repo && make test-tvos"

archive-demo-ios:
needs: test-ios
runs-on:
labels: [tart, macos]
steps:
- name: Archive the iOS demo
run: |
~/macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} "cd ~/_repo && security unlock-keychain -p 'admin' ~/Library/Keychains/login.keychain-db && make archive-demo-ios"
# archive-demo-ios:
# needs: test-ios
# runs-on:
# labels: [tart, macos]
# steps:
# - name: Archive the iOS demo
# run: |
# ~/macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} "cd ~/_repo && security unlock-keychain -p 'admin' ~/Library/Keychains/login.keychain-db && make archive-demo-ios"

archive-demo-tvos:
needs: test-tvos
runs-on:
labels: [tart, macos]
steps:
- name: Archive the tvOS demo
run: |
~/macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} "cd ~/_repo && security unlock-keychain -p 'admin' ~/Library/Keychains/login.keychain-db && make archive-demo-tvos"
# archive-demo-tvos:
# needs: test-tvos
# runs-on:
# labels: [tart, macos]
# steps:
# - name: Archive the tvOS demo
# run: |
# ~/macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} "cd ~/_repo && security unlock-keychain -p 'admin' ~/Library/Keychains/login.keychain-db && make archive-demo-tvos"

clean:
runs-on:
labels: [tart, macos]
needs: [archive-demo-ios, archive-demo-tvos]
if: always()
steps:
- name: Stop and remove the VM
run: |
set +e
~/macos-ci-setup/store-vm-caches.sh ${{ env.vm_name }}
orchard delete vm ${{ env.vm_name }}
# clean:
# runs-on:
# labels: [tart, macos]
# needs: [archive-demo-ios, archive-demo-tvos]
# if: always()
# steps:
# - name: Stop and remove the VM
# run: |
# set +e
# ~/macos-ci-setup/store-vm-caches.sh ${{ env.vm_name }}
# tart stop ${{ env.vm_name }}
# tart delete ${{ env.vm_name }}

0 comments on commit 33cc1d4

Please sign in to comment.