Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 7 additions & 33 deletions .github/workflows/mt-dependency-update-baseline.yml
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot https://github.com/mtransitapps/gh-actions/blob/master/.github/actions/setup/action.yml the action does way more, please replace all the steps duplicated here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in commit 970353a: I removed the duplicated steps (checkout_submodules, submodule branch switching, module branch checkout/pull, MT_GIT_BRANCH setup, and ./commons/code_setup.sh) and now rely on mtransitapps/gh-actions/.github/actions/setup@v1.0.1 for that setup behavior.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ env:
MT_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
MT_TARGET_BRANCH_NAME: ${{ github.base_ref || github.ref_name }}
MT_DEFAULT_BRANCH_NAME: ${{ github.event.repository.default_branch }}
# repo type
MT_IS_SUBMODULE: ${{ contains(fromJSON('["mtransitapps/commons", "mtransitapps/commons-java", "mtransitapps/parser", "mtransitapps/commons-android"]'), github.repository) }}
MT_IS_MAIN_REPO: ${{ endsWith(github.repository, '/mtransit-for-android') }}
MT_IS_AGENCY_REPO: ${{ ! contains(fromJSON('["mtransitapps/commons", "mtransitapps/commons-java", "mtransitapps/parser", "mtransitapps/commons-android"]'), github.repository) && ! endsWith(github.repository, '/mtransit-for-android')}}
jobs:
MT-DEPENDENCY-UPDATE-BASELINE-JOB:
name: "MT Dependency update baseline"
Expand Down Expand Up @@ -53,39 +57,9 @@ jobs:
submodules: true # required to set right token
token: ${{ secrets.MT_PAT || secrets.MT_DEPENDABOT_PAT }} # use our token to trigger workflow events, if available
fetch-depth: 0 # fetch all (not required util release build)
- name: MT check out submodules
run: ./checkout_submodules.sh
- name: MT check out all git submodule closest branch
if: github.event_name == 'pull_request'
run: |
echo "[MT] > Checking out submodules closest branch, '$MT_BRANCH_NAME' or '$MT_TARGET_BRANCH_NAME' or '$MT_DEFAULT_BRANCH_NAME':"
git submodule foreach 'git checkout $MT_BRANCH_NAME || git checkout $MT_TARGET_BRANCH_NAME || git checkout $MT_DEFAULT_BRANCH_NAME'
echo "[MT] > Showing submodules current branch:"
git submodule foreach 'git branch --show-current'
- name: MT check out this module repo build branch
run: |
REPOSITORY_OWNER_AND_NAME=${{ github.repository }};
REPOSITORY_NAME=$(basename $REPOSITORY_OWNER_AND_NAME);
echo "Repository name: '$REPOSITORY_NAME'."
echo "Fetching from repo '$REPOSITORY_NAME':"
git -C $REPOSITORY_NAME fetch -v --all;
echo "Checking our this repo '$REPOSITORY_NAME' workflow branch '$MT_BRANCH_NAME':"
git -C $REPOSITORY_NAME switch $MT_BRANCH_NAME;
echo "Pulling from repo '$REPOSITORY_NAME':"
git -C $REPOSITORY_NAME pull -v;
- name: MT setup MT_GIT_BRANCH env
if: github.event_name != 'pull_request'
run: |
echo "MT_GIT_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: MT code setup
run: ./commons/code_setup.sh
- name: MT set up JDK 17
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
- name: MT setup
id: mt-setup
uses: mtransitapps/gh-actions/.github/actions/setup@v1.0.1
- name: MT dependency update baseline
run: ./dependency_update_baseline.sh
- name: MT commit new baseline
Expand Down