Skip to content

Disable caching

Disable caching #438

Workflow file for this run

name: Test
on: push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: 'Test'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
group: [0, 1, 2, 3, 4, 5]
steps:
- uses: actions/checkout@v4
- name: Install vendor
run: ./install_vendor.sh ${{ secrets.vendor_url }}
# PulseAudio does not work in Docker container
- name: Patch FMOD to disable sound
run: |
sed -i'' \
's/result = coreSystem.setOutput(outputType);/result = coreSystem.setOutput(FMOD.OUTPUTTYPE.NOSOUND);/' \
Assets/Plugins/FMOD/src/RuntimeManager.cs
# May be causing intermittent error: Unable to find type [UnityEngine.CoreModule.dll]
# - name: Cache Library
# uses: actions/cache@v4
# with:
# path: Library
# key: Library
- name: Get tests for the current group
id: get_tests
run: |
tests=$(cat Assets/test/*.test.cs |
perl -ne 'm/public class (\w+) : ABaseTest/ && print "$1\n"' |
awk "NR % $GROUP_COUNT == $GROUP" |
paste -sd ';' -)
echo "tests=$tests" | tee -a $GITHUB_OUTPUT
env:
GROUP_COUNT: 6
GROUP: ${{ matrix.group }}
- name: Run tests
uses: 12joan/ci-unity-test-runner@main
env:
# gh secret set UNITY_LICENSE < /Library/Application\ Support/Unity/Unity_lic.ulf
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
customParameters: -testFilter ${{ steps.get_tests.outputs.tests }}
- name: Upload Percy screenshots
uses: actions/upload-artifact@v4
if: always()
with:
name: Percy (${{ matrix.group }})
path: Percy
- name: Upload results
uses: actions/upload-artifact@v4
if: always()
with:
name: Test results (${{ matrix.group }})
path: artifacts
percy:
name: 'Percy'
runs-on: ubuntu-latest
needs: test
if: always()
steps:
- uses: actions/checkout@v4
- name: Install Yarn dependencies
run: yarn install
- name: Download screenshot artifacts
uses: actions/download-artifact@v4
with:
path: Percy
pattern: Percy (*)
merge-multiple: true
- name: Upload screenshots to Percy
run: yarn percy:upload
env:
# gh secret set PERCY_TOKEN <a Percy Web token>
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}