Skip to content

Commit

Permalink
ADDED: automatic testing on Github CI
Browse files Browse the repository at this point in the history
  • Loading branch information
WinPlay02 committed Nov 13, 2023
1 parent 014ab1e commit 6df16c2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: GitCraft-Next CI

on:
push:
branches: [ "master", "experimental" ]
pull_request:
branches: [ "master", "experimental" ]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 20
uses: actions/setup-java@v3
with:
java-version: '20'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Test GitCraft
run: ./gradlew test
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public void mappingsMojang() throws IOException {
assertEquals(Step.StepResult.UP_TO_DATE, GitCraft.MOJANG_MAPPINGS.prepareMappings(versionGraph.getMinecraftVersionByName("1.20")));
assertTrue(Files.size(mappingsPath) > 0);
assertFalse(GitCraft.MOJANG_MAPPINGS.supportsComments());
assertFalse(GitCraft.MOJANG_MAPPINGS.supportsConstantUnpicking());
assertNotNull(GitCraft.MOJANG_MAPPINGS.getMappingsProvider(versionGraph.getMinecraftVersionByName("1.20")));
assertEquals(MappingsNamespace.OFFICIAL.toString(), GitCraft.MOJANG_MAPPINGS.getSourceNS());
assertEquals(MappingsNamespace.NAMED.toString(), GitCraft.MOJANG_MAPPINGS.getDestinationNS());
Expand All @@ -110,6 +111,7 @@ public void mappingsParchment() throws IOException {
assertEquals(Step.StepResult.UP_TO_DATE, GitCraft.MOJANG_PARCHMENT_MAPPINGS.prepareMappings(versionGraph.getMinecraftVersionByName("1.20.1")));
assertTrue(Files.size(mappingsPath) > 0);
assertTrue(GitCraft.MOJANG_PARCHMENT_MAPPINGS.supportsComments());
assertFalse(GitCraft.MOJANG_PARCHMENT_MAPPINGS.supportsConstantUnpicking());
assertEquals(MappingsNamespace.OFFICIAL.toString(), GitCraft.MOJANG_PARCHMENT_MAPPINGS.getSourceNS());
assertEquals(MappingsNamespace.NAMED.toString(), GitCraft.MOJANG_PARCHMENT_MAPPINGS.getDestinationNS());
}
Expand All @@ -131,6 +133,7 @@ public void mappingsFabricIntermediary() throws IOException {
assertEquals(Step.StepResult.UP_TO_DATE, GitCraft.FABRIC_INTERMEDIARY_MAPPINGS.prepareMappings(versionGraph.getMinecraftVersionByName("1.20")));
assertTrue(Files.size(mappingsPath) > 0);
assertFalse(GitCraft.FABRIC_INTERMEDIARY_MAPPINGS.supportsComments());
assertFalse(GitCraft.FABRIC_INTERMEDIARY_MAPPINGS.supportsConstantUnpicking());
assertEquals(MappingsNamespace.OFFICIAL.toString(), GitCraft.FABRIC_INTERMEDIARY_MAPPINGS.getSourceNS());
assertEquals(MappingsNamespace.INTERMEDIARY.toString(), GitCraft.FABRIC_INTERMEDIARY_MAPPINGS.getDestinationNS());
}
Expand Down Expand Up @@ -234,7 +237,8 @@ public void mappingsYarn() throws IOException {
assertTrue(Files.exists(mappingsPathTest));
assertEquals(Step.StepResult.UP_TO_DATE, GitCraft.YARN_MAPPINGS.prepareMappings(versionGraph.getMinecraftVersionBySemanticVersion("1.14.5-combat.2")));
}
assertFalse(GitCraft.YARN_MAPPINGS.supportsComments());
assertTrue(GitCraft.YARN_MAPPINGS.supportsComments());
assertTrue(GitCraft.YARN_MAPPINGS.supportsConstantUnpicking());
assertEquals(MappingsNamespace.OFFICIAL.toString(), GitCraft.YARN_MAPPINGS.getSourceNS());
assertEquals(MappingsNamespace.NAMED.toString(), GitCraft.YARN_MAPPINGS.getDestinationNS());
}
Expand Down

0 comments on commit 6df16c2

Please sign in to comment.