Improve workflow #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: CI | |
on: [push] | |
jobs: | |
install-tools: | |
runs-on: | |
labels: [tart, macos] | |
steps: | |
- name: Print secret | |
env: | |
MACOS_CI_SETUP_TOKEN: ${{ secrets.MACOS_CI_SETUP_TOKEN }} | |
run: | | |
if [ -z $MACOS_CI_SETUP_TOKEN ]; then | |
echo "MACOS_CI_SETUP_TOKEN is not set !" | |
else | |
echo "MACOS_CI_SETUP_TOKEN is set..." | |
fi | |
- name: Clone macos-ci-setup repository | |
env: | |
MACOS_CI_SETUP_TOKEN: ${{ secrets.MACOS_CI_SETUP_TOKEN }} | |
run: | | |
rm -rf ~/macos-ci-setup | |
git clone -b add-scripts https://[email protected]/SRGSSR/macos-ci-setup.git ~/macos-ci-setup | |
- name: Install tools | |
env: | |
MACOS_CI_SETUP_TOKEN: ${{ secrets.MACOS_CI_SETUP_TOKEN }} | |
run: | | |
cd ~/macos-ci-setup | |
./create-vm-for-project-non-interactive.sh sonoma-fake-pillarbox ghcr.io/cirruslabs/macos-sonoma-xcode:latest | |
./clone-repo-in-vm.sh "https://[email protected]/SRGSSR/fake-and-temporary-pa-for-runners.git" sonoma-fake-pillarbox | |
./run-vm-shell-command.sh sonoma-fake-pillarbox "brew install mint shellcheck markdownlint-cli yamllint ffmpeg" | |
./run-vm-shell-command.sh sonoma-fake-pillarbox "rbenv install --skip-existing 3.3.2" | |
./run-vm-shell-command.sh sonoma-fake-pillarbox "echo \"export PATH=\"$HOME/.rbenv/bin:$PATH\"\" > ~/.zshrc" | |
./run-vm-shell-command.sh sonoma-fake-pillarbox "rbenv global 3.3.2" | |
./run-vm-shell-command.sh sonoma-fake-pillarbox "gem install bundler -v 2.4.6" | |
./run-vm-shell-command.sh sonoma-fake-pillarbox "source ~/.zshrc" | |
./run-vm-shell-command.sh sonoma-fake-pillarbox "cd ~/_repo && rm -rf Configuration" | |
./run-vm-shell-command.sh sonoma-fake-pillarbox "cd ~/_repo && Scripts/checkout-configuration.sh https://[email protected]/SRGSSR/pillarbox-apple-configuration.git dad52a4242c7997c179073caec03b8d6e718fc03 Configuration" | |
./run-vm-shell-command.sh sonoma-fake-pillarbox "cd ~/_repo && make setup" | |
check-quality: | |
needs: install-tools | |
runs-on: | |
labels: [tart, macos] | |
steps: | |
- name: Run the quality check | |
run: | | |
~/macos-ci-setup/run-vm-shell-command.sh sonoma-fake-pillarbox "cd ~/_repo && make check-quality" | |
run-streams: | |
needs: install-tools | |
runs-on: | |
labels: [tart, macos] | |
steps: | |
- name: Run test streams | |
run: | | |
~/macos-ci-setup/run-vm-shell-command.sh sonoma-fake-pillarbox "cd ~/_repo && make test-streams-start" | |
test-ios: | |
needs: run-streams | |
runs-on: | |
labels: [tart, macos] | |
steps: | |
- name: Run the iOS tests | |
run: | | |
~/macos-ci-setup/run-vm-shell-command.sh sonoma-fake-pillarbox "cd ~/_repo && make test-ios" | |
test-tvos: | |
needs: run-streams | |
runs-on: | |
labels: [tart, macos] | |
steps: | |
- name: Run the tvOS tests | |
run: | | |
~/macos-ci-setup/run-vm-shell-command.sh sonoma-fake-pillarbox "cd ~/_repo && make test-tvos" | |
clean: | |
runs-on: | |
labels: [tart, macos] | |
needs: [install-tools, check-quality, run-streams, test-ios, test-tvos] | |
if: always() | |
steps: | |
- name: Stop and remove the VM | |
run: | | |
set +e | |
tart stop sonoma-fake-pillarbox | |
tart delete sonoma-fake-pillarbox |