Test your repo manifest repository #137
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: Test your repo manifest repository | |
on: | |
workflow_dispatch: | |
inputs: | |
LOCAL_MANIFEST_URL: | |
description: 'LOCAL_MANIFEST_URL (if want to use SSH keys, use git@github.com:XXXXX)' | |
required: true | |
default: 'https://github.com/sounddrill31/local_manifests' | |
LOCAL_MANIFEST_BRANCH: | |
description: 'LOCAL_MANIFEST_BRANCH' | |
required: true | |
default: 'lineage-oxygen' | |
ROM_MANIFEST_URL: | |
description: 'MANIFEST_URL (if want to use SSH keys, use git@github.com:XXXXX)' | |
required: true | |
default: 'https://github.com/LineageOS/android' | |
ROM_MANIFEST_BRANCH: | |
description: 'MANIFEST_BRANCH' | |
required: true | |
default: 'lineage-20.0' | |
CHOICE: | |
type: choice | |
description: 'Which would you like to test?' | |
options: | |
- ROM_MANIFEST | |
- LOCAL_MANIFEST | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install repo tool | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y git-core python3-pip wget | |
wget https://storage.googleapis.com/git-repo-downloads/repo && sudo mv repo /usr/bin/repo && sudo chmod a+x /usr/bin/repo | |
- name: Initialize and Sync Repo for Manifest | |
run: | | |
rm -rf workspace | |
mkdir workspace | |
cd workspace | |
echo "workspace-folder=$(pwd)" >> $GITHUB_OUTPUT | |
git config --global user.name "${{ github.actor }}" | |
git config --global user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" | |
if [ "${{ github.event.inputs.choice }}" == "ROM_MANIFEST" ]; then | |
repo init --depth=1 -u ${{ github.event.inputs.ROM_MANIFEST_URL }} -b ${{ github.event.inputs.ROM_MANIFEST_BRANCH }} --git-lfs | |
else | |
rm -rf .repo/local_manifests && | |
repo init --depth=1 -u ${{ github.event.inputs.ROM_MANIFEST_URL }} -b ${{ github.event.inputs.ROM_MANIFEST_BRANCH }} --git-lfs && | |
git clone ${{ github.event.inputs.LOCAL_MANIFEST_URL }} -b ${{ github.event.inputs.LOCAL_MANIFEST_BRANCH }} .repo/local_manifests | |
fi | |
timeout 2m repo sync --force-sync || { exit_code=$?; [ $exit_code -eq 124 ] || (echo "Error: Process failed with exit code $exit_code"; exit $exit_code); } | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: true |