Skip to content

Commit

Permalink
refactor(ci): drop dependency on PackSquash-action-test repository
Browse files Browse the repository at this point in the history
This dependency is unnecessary, because that repository was focused on
testing the action, and to test the action we already have some
automated workflows at this repository.

For testing in other environments, the new reusable workflow step
commands can be directly copied and pasted to an Unix-like shell, which
is almost as easy as running `git clone`, but with the added advantage
that at least someone (me) will look at and update this commands
periodically.

While at it, let's update the referenced pack versions to test more
up-to-date packs, which are likely to be more representative of end
PackSquash usage.
  • Loading branch information
AlexTMjugador committed Aug 12, 2023
1 parent 0514f66 commit 567c0e4
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 23 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/actions/set_up_repo_with_submodules/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Set up empty Git repository with public pack submodules
description: Reusable steps to set up a repository with packs in submodules for testing
runs:
using: composite
steps:
# The packs checked out by these steps are distributed to the public
# and, to the best of our knowledge, used in conformance with the
# usage rights given in their licenses, which are, in no particular
# order:
# - CC BY 4.0,
# - CC BY-NC-SA 4.0,
# - Custom licenses.
# Thanks to their authors for making such great packs!
- name: Set up empty Git repository with public pack submodules
shell: sh
run: |
git -c init.defaultBranch=master init
while read -r submodule_info; do
url="${submodule_info%% *}"
name="${submodule_info#* }"
name="${name% *}"
commitish="${submodule_info##* }"
git submodule add "$url" "$name"
git -C "$name" -c advice.detachedHead=false checkout "$commitish"
git add "$name"
done <<'SUBMODULES'
https://github.com/PoeticRainbow/golden-days.git golden-days 1.9.0
https://github.com/Crackers0106/Programmer-Art-Plus.git Programmer-Art-Plus 8ddc173e274094588f04d1c989a58378fb56b303
https://github.com/SummerFields/SummerFields.git SummerFields 645be0fc27495117a7decc96fee810ff1ed584ab
SUBMODULES
GIT_AUTHOR_NAME='github-actions[bot]' GIT_AUTHOR_EMAIL='41898282+github-actions[bot]@users.noreply.github.com' \
GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME" GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL" \
git commit -m 'Root commit'
20 changes: 6 additions & 14 deletions .github/workflows/test_pack_in_submodule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,19 @@ jobs:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork

steps:
- name: Clone pack repository
uses: actions/checkout@v3
with:
repository: ComunidadAylas/PackSquash-action-test
fetch-depth: 0
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}
- name: Clone action repository
uses: actions/checkout@v3
with:
path: action-checkout
- name: Modify pack files
path: action
- name: Set up empty Git repository with public pack submodules
uses: ./action/.github/workflows/actions/set_up_repo_with_submodules
- name: Modify pack files (test that working directory changes are handled well)
run: |
echo '{ "pack": { "pack_format": 8, "description": "Dummy pack.mcmeta" } }' > golden-days/golden-days-base/pack.mcmeta
touch golden-days/golden-days-base/assets/minecraft/sounds.json
mv golden-days/golden-days-base/credits.txt golden-days/golden-days-base/credits_new.txt
# Remove some files that generate GStreamer negotiation errors on v0.3.1.
# This also serves to check that the action handles files being deleted from the working copy correctly
rm golden-days/golden-days-base/assets/minecraft/sounds/liquid/*.ogg
rm golden-days/golden-days-base/assets/minecraft/optifine/color.properties
- name: Run PackSquash
uses: ./action-checkout
uses: ./action
with:
packsquash_version: latest
options: |
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/test_pack_submodule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,14 @@ jobs:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork

steps:
- name: Clone pack repository
uses: actions/checkout@v3
with:
repository: ComunidadAylas/PackSquash-action-test
fetch-depth: 0
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}
- name: Clone action repository
uses: actions/checkout@v3
with:
path: action-checkout
path: action
- name: Set up empty Git repository with public pack submodules
uses: ./action/.github/workflows/actions/set_up_repo_with_submodules
- name: Run PackSquash
uses: ./action-checkout
uses: ./action
with:
packsquash_version: latest
options: |
Expand Down

0 comments on commit 567c0e4

Please sign in to comment.