diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0877f3b..4673613 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,22 +1,37 @@ -name: Actions 😎 +# Taking notes... +# https://github.com/modesttree/Zenject/blob/master/.github/workflows/main.yml + +name: Test and build on: pull_request: {} push: { branches: [main, develop] } jobs: - readmeWorkflow: - name: Readme Workflow ✨ + buildAndTestForSupportedPlatforms: + name: Build for ${{ matrix.targetPlatform }} on version ${{ matrix.unityVersion }} runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + unityVersion: + - 2020.3.29f1 + targetPlatform: + - StandaloneWindows64 # Build a Windows 64-bit standalone. + - Android # Build a Android standalone. + steps: - name: Checkout code uses: actions/checkout@v2 + with: + fetch-depth: 0 + lfs: true - name: Restore Library cache uses: actions/cache@v2 with: path: Library - key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} + key: Library-${{ matrix.targetPlatform }} restore-keys: | Library- @@ -25,8 +40,11 @@ jobs: uses: game-ci/unity-test-runner@v2 env: UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} with: githubToken: ${{ secrets.GITHUB_TOKEN }} + unityVersion: ${{ matrix.unityVersion }} # Build - name: Build project @@ -36,7 +54,8 @@ jobs: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} with: - targetPlatform: [StandaloneWindows64, Android] + unityVersion: ${{ matrix.unityVersion }} + targetPlatform: ${{ matrix.targetPlatform }} # Output - uses: actions/upload-artifact@v2