Testing Github Actions CI

This commit is contained in:
Anuken 2020-11-19 18:53:02 -05:00
parent 15ef32447c
commit f71b726877
10 changed files with 116 additions and 34 deletions

52
.github/workflows/deployment.yml vendored Normal file
View File

@ -0,0 +1,52 @@
name: Deployment
on:
push:
tags:
- 'v*'
jobs:
buildJava14:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: 14
- name: Create artifacts
run: |
./gradlew desktop:dist server:dist core:javadoc -Pbuildversion=${GITHUB_REF:1}"
- name: Update docs
run: |
cd ../
git clone --depth=1 https://github.com/MindustryGame/docs.git
cp -a Mindustry/core/build/docs/javadoc/. docs/
cd docs
git add .
git commit -m "Update ${GITHUB_REF:1}"
git push https://Anuken:${{ secrets.GITHUB_TOKEN }}@github.com/MindustryGame/docs
cd ../Mindustry
- name: Update F-Droid build string
run: |
git clone --depth=1 --branch=master https://github.com/Anuken/MindustryBuilds ../MindustryBuilds
cd ../MindustryBuilds
echo "Updating version to ${GITHUB_REF:1}"
echo versionName=6-fdroid-${GITHUB_REF:1}$'\n'versionCode=${GITHUB_REF:1} > version_fdroid.txt
git add .
git commit -m "Updating to build ${GITHUB_REF:1}"
cd ../Mindustry
- name: Upload client artifacts
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: desktop/libs/Mindustry.jar
tag: ${{ github.ref }}
- name: Upload server artifacts
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: server/libs/server-release.jar
tag: ${{ github.ref }}

View File

@ -1,27 +0,0 @@
name: Java CI
on: [push, pull_request]
jobs:
buildJava14:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: 14
- name: Run unit tests with gradle and Java 14
run: ./gradlew compileJava
buildJava15:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 15
uses: actions/setup-java@v1
with:
java-version: 15
- name: Run unit tests with gradle and Java 15
run: ./gradlew compileJava

21
.github/workflows/pr.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: Pull Request Tests
on: [pull_request]
jobs:
buildJava14:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: 14
- name: Run unit tests and build JAR
run: ./gradlew test desktop:dist
- name: Upload desktop JAR for testing
uses: actions/upload-artifact@v2
with:
name: Desktop JAR (zipped)
path: desktop/build/libs/Mindustry.jar

23
.github/workflows/push.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: Test & Push BUilds
on: [push]
jobs:
buildJava14:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: 14
- name: Run unit tests
run: ./gradlew test
- name: Trigger BE build
run: |
git clone --depth=1 --branch=master https://github.com/Anuken/MindustryBuilds ../MindustryBuilds
cd ../MindustryBuilds
git tag ${GITHUB_RUN_NUMBER}
git config --global user.name "Build Uploader"
git push https://Anuken:${{ secrets.GITHUB_TOKEN }}@github.com/Anuken/MindustryBuilds ${GITHUB_RUN_NUMBER}

View File

@ -29,7 +29,7 @@ script:
- cd ../Mindustry
deploy:
- provider: releases
cleanup: false
skip_cleanup: true
draft: false
api_key:
secure: Cv5wFtWt62/A24EvSEQvMow7gKPbZ3oATEFPuSghhB2TQz1dA40Zee3Qvk4LFlpLrhYo4K0ZSczCZRGpR+hCd8+Dpww52bheYEvWuh3ZQfvu/fXtEx2j5PwP1qMpmIgSxETV/gkD7l9FImdh0VzktYiAvQfmi0bEocG9/D4QwjFpNat7iwBdcMiw1MvAygpdIWRsjiw0RKlB2mWarmoHhQ7Gu7qlU3j50uaEvcrtmU0pBUPggNQwQRv32i9NPvNFxrqqlUjDLIS8JFea99zCkp8BwYqbEvBIMzd+Qip1/stLJJA3+cDUClbsDtg8rAVetzpOrdLEEBmqShFe5MDl2yEHcsgpN9CFsyTaUfvB3P3rVjizvycMm42IsUkXQiarm5xTQ/TIA8Rd8AHiSKuweNCg1Fd5SFaRtKy8JVLXuxyfUccmyje6hhz2L4lS2Wfj3mAG7sqZUCXhWP79EKdGkiPOjKv4CwXEKmuH3BMVqPlNUZJr9Eg3sV1FG0h2l+MVOOnR635qdUbb49sYojYxVruMLX0BH1c4ZCu230m8CUoWA1Em1QNI75ya7+9Y5T6AsgWDVpBvdUo9fWNbdp+VQ0GskFQsJD5wtnxbcbHeFiERAgGBm7z6qt9u9LrQpBH+dsW52ADvYsu3L4nQEa+sdMHwTTwmGY+iUvsxu0DqxGg=

View File

@ -40,8 +40,6 @@ public class Planets implements ContentList{
startSector = 10;
atmosphereRadIn = -0.01f;
atmosphereRadOut = 0.3f;
accessible = false;
visible = false;
}};*/
serpulo = new Planet("serpulo", sun, 3, 1){{

View File

@ -257,10 +257,10 @@ public class Waves{
public static Seq<SpawnGroup> generate(float difficulty){
//apply power curve to make starting sectors easier
return generate(new Rand(), Mathf.pow(difficulty, 1.12f));
return generate(Mathf.pow(difficulty, 1.12f), new Rand(), false);
}
public static Seq<SpawnGroup> generate(Rand rand, float difficulty){
public static Seq<SpawnGroup> generate(float difficulty, Rand rand, boolean attack){
UnitType[][] species = {
{dagger, mace, fortress, scepter, reign},
{nova, pulsar, quasar, vela, corvus},
@ -395,6 +395,21 @@ public class Waves{
effect = StatusEffects.boss;
}});
//add megas to heal the base.
if(attack && difficulty >= 0.5){
int amount = Mathf.random(1, 3 + (int)(difficulty*2));
for(int i = 0; i < amount; i++){
int wave = Mathf.random(3, 20);
out.add(new SpawnGroup(mega){{
unitAmount = 1;
begin = wave;
end = wave;
max = 16;
}});
}
}
//shift back waves on higher difficulty for a harder start
int shift = Math.max((int)(difficulty * 15 - 5), 0);

View File

@ -439,7 +439,7 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{
state.rules.waves = sector.info.waves = true;
state.rules.enemyCoreBuildRadius = 600f;
state.rules.spawns = Waves.generate(difficulty);
state.rules.spawns = Waves.generate(difficulty, new Rand(), state.rules.attackMode);
}
@Override

View File

@ -15,7 +15,7 @@ public class TantrosPlanetGenerator extends PlanetGenerator{
@Override
public Color getColor(Vec3 position){
float depth = (float)noise.octaveNoise3D(2, 0.56, 1.7f, position.x, position.y, position.z) / 1.7f;
float depth = (float)noise.octaveNoise3D(2, 0.56, 1.7f, position.x, position.y, position.z) / 2f;
return c1.write(out).lerp(c2, Mathf.clamp(Mathf.round(depth, 0.15f))).a(0.6f);
}
}