-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
226 additions
and
17 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Pack checker | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pr_number: | ||
description: 'Pull Request number' | ||
type: number | ||
zip_url: | ||
description: 'Zip file URL' | ||
type: string | ||
repository_url: | ||
description: 'Repository URL' | ||
type: string | ||
branch: | ||
description: 'Branch (to be used with repository_url' | ||
type: string | ||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Checkout repository if provided | ||
uses: actions/checkout@v3 | ||
if: ${{ github.event.inputs.repository_url != '' && github.event.inputs.branch != '' }} | ||
with: | ||
repository: ${{ github.event.inputs.repository_url }} | ||
ref: ${{ github.event.inputs.branch }} | ||
path: "pack" | ||
|
||
- name: Download and extract zip if provided | ||
if: ${{ github.event.inputs.zip_url != '' }} | ||
env: | ||
PACK_URL: ${{ github.event.inputs.zip_url }} | ||
run: | | ||
curl -o pack.zip -L ${PACK_URL} | ||
unzip -q pack.zip -d pack-tmp/ | ||
mkdir -p pack/ | ||
mv $(find pack-tmp/ -name pack.properties -printf "%h")/* pack | ||
- name: Checkout pull request if provided | ||
uses: actions/checkout@v3 | ||
if: ${{ github.event.inputs.pr_number != '' }} | ||
with: | ||
repository: 'melkypie/resource-packs' | ||
path: "pack" | ||
- name: Checkout pull request if provided | ||
if: ${{ github.event.inputs.pr_number != '' }} | ||
env: | ||
PR: ${{ github.event.inputs.pr_number }} | ||
run: | | ||
cd pack/ | ||
git fetch origin pull/${PR}/head:${PR} | ||
git checkout ${PR} | ||
- name: Download the latest vanilla sprites | ||
uses: dsaltares/[email protected] | ||
with: | ||
repo: 'melkypie/sprite-exporter' | ||
file: '.*-sprites\.zip' | ||
regex: true | ||
target: "./" | ||
- name: Extract latest vanilla sprites | ||
run: unzip -jq *-sprites.zip -d sprites/ | ||
|
||
- uses: actions/setup-java@v2 | ||
with: | ||
java-version: 8 | ||
distribution: temurin | ||
cache: gradle | ||
- name: Run unneccessary file check on the pack | ||
run: | | ||
set -e -x | ||
chmod +x gradlew | ||
./gradlew test -DspriteFolder="sprites" -DpackFolder="pack" --tests "melky.resourcepacks.ResourcePacksPluginTest.checkUnneededFiles" --info --rerun-tasks |
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
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