Add tzhaar city and fight caves #1002
Workflow file for this run
This file contains hidden or 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
| name: Run Tests | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| - 'release/**' | |
| pull_request: | |
| branches: [ 'main' ] | |
| env: | |
| CACHE_VERSION: 1.4.5 | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout repository code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-java@v3 | |
| with: | |
| java-version: "21" | |
| distribution: "temurin" | |
| architecture: x64 | |
| cache: "gradle" | |
| - name: Validate Gradle wrapper | |
| uses: gradle/actions/wrapper-validation@v4 | |
| - name: Check formatting | |
| run: ./gradlew spotlessCheck | |
| - name: Create cache folder | |
| run: mkdir -p data/cache/ | |
| - name: Check if secrets exists | |
| id: check_secret | |
| run: | | |
| if [ -n "${{ secrets.AWS_ACCESS_KEY_ID }}" ]; then | |
| echo "exists=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "exists=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Grant Permissions to gradlew | |
| run: chmod +x gradlew | |
| - name: Get cache version | |
| run: echo "cache_version=$(./gradlew -q printCacheVersion | tail -n1 | xargs)" >> $GITHUB_ENV | |
| - name: Restore game cache files from cache | |
| id: cache-files | |
| uses: actions/cache@v3 | |
| with: | |
| key: cache-${{ env.cache_version }}-${{ hashFiles('data/cache/main_file_cache.idx255') }} | |
| path: data/cache/ | |
| enableCrossOsArchive: 'true' | |
| restore-keys: | |
| cache-${{ env.cache_version }} | |
| cache- | |
| - name: Download game cache files (on main branch only) | |
| if: steps.check_secret.outputs.exists == 'true' && steps.cache-files.outputs.cache-hit != 'true' | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| AWS_DEFAULT_REGION: eu-west-2 | |
| run: aws s3 cp --recursive s3://void-rsps/caches/${{ env.CACHE_VERSION }}/ data/cache/ | |
| - name: Check if cache files exist | |
| id: check-cache-files | |
| run: | | |
| if [ -f "data/cache/main_file_cache.idx255" ] && [ -f "data/cache/main_file_cache.dat2" ]; then | |
| echo "cache_exists=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "cache_exists=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Run all tests | |
| if: steps.check-cache-files.outputs.cache_exists == 'true' | |
| run: ./gradlew test | |
| env: | |
| GRADLE_OPTS: -Xmx5g -Xms1g -XX:MaxMetaspaceSize=1g | |
| - name: Run unit tests | |
| if: steps.check-cache-files.outputs.cache_exists != 'true' | |
| run: ./gradlew test -x :game:test | |
| - name: Upload coverage report to Codecov | |
| if: steps.check_secret.outputs.exists == 'true' | |
| uses: codecov/codecov-action@v4.1.0 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| slug: GregHib/void |