diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b3a5bbd..7f73d8c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,10 +1,9 @@ name: Actions 😎 on: - pull_request: {} push: { branches: [master] } - -env: - UNITY_LICENSE: "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \nJHdOBFmBNq2H8BrGFzir/StLoYo=aENLHd37a51RtP2/g7YU0Pexf5mx0/ENXYGtrPzqwZ8NQt2AsSdxGnl0CUB45/GuNXfJVDt2HWot\ncNYZB2OylVBn1WHQbKZlPmm8gEAMz0MYbr4Isb5i5buryBrZlmbEOjnRI+pEg1CBwlgMo6xdtjjE\n/d7cC293QIUO91kdzRXftYou1dNaUyuPL9ZH65vdB2pDXGRNxgUVD+GnnqZA7b5L2HXqNQclcWAK\n5Yd1BeF3VzR1iLw9G/SmH5oOhnpXSmqbL4qk7LVP2/mgXpFk5kP4X8VC3z47obNhBIGq40dwWyEe\nUYk5/nRAOkZawDT+tcu96e06gPC9Cxk5PdbRbA==" + pull_request_target: + paths-ignore: + - ".github/**" jobs: tests: @@ -35,9 +34,25 @@ jobs: - playmode - editmode steps: - - uses: actions/checkout@v2 + ########################### + # Checkout # + ########################### + - name: Checkout (default) + uses: actions/checkout@v2 + if: github.event.event_type != 'pull_request_target' with: lfs: true + - name: Checkout (pull_request_target) + uses: actions/checkout@v2 + if: github.event.event_type == 'pull_request_target' + with: + lfs: true + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + + ########################### + # Cache # + ########################### - uses: actions/cache@v2 with: path: ${{ matrix.projectPath }}/Library @@ -52,6 +67,8 @@ jobs: testMode: ${{ matrix.testMode }} artifactsPath: ${{ matrix.testMode }}-artifacts customParameters: -profile SomeProfile -someBoolean -someValue exampleValue + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} - uses: actions/upload-artifact@v2 with: name: Test results for ${{ matrix.testMode }} @@ -69,13 +86,25 @@ jobs: unityVersion: - 2019.2.11f1 steps: - # Checkout repository (required to test local actions) - - name: Checkout repository + ########################### + # Checkout # + ########################### + - name: Checkout (default) uses: actions/checkout@v2 + if: github.event.event_type != 'pull_request_target' with: lfs: true + - name: Checkout (pull_request_target) + uses: actions/checkout@v2 + if: github.event.event_type == 'pull_request_target' + with: + lfs: true + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - # Enable caching + ########################### + # Cache # + ########################### - uses: actions/cache@v1.1.0 with: path: ${{ matrix.projectPath }}/Library @@ -93,6 +122,8 @@ jobs: unityVersion: ${{ matrix.unityVersion }} testMode: all # Test implicit artifactsPath, by not setting it + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} # Upload artifacts - name: Upload test results @@ -113,13 +144,25 @@ jobs: projectPath: - unity-project-with-correct-tests steps: - # Checkout repository (required to test local actions) - - name: Checkout repository + ########################### + # Checkout # + ########################### + - name: Checkout (default) uses: actions/checkout@v2 + if: github.event.event_type != 'pull_request_target' with: lfs: true + - name: Checkout (pull_request_target) + uses: actions/checkout@v2 + if: github.event.event_type == 'pull_request_target' + with: + lfs: true + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - # Enable caching + ########################### + # Cache # + ########################### - uses: actions/cache@v1.1.0 with: path: ${{ matrix.projectPath }}/Library @@ -137,6 +180,8 @@ jobs: unityVersion: ${{ matrix.unityVersion }} testMode: editmode artifactsPath: artifacts/editmode + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} # Upload artifacts - name: Upload test results @@ -157,13 +202,25 @@ jobs: unityVersion: - 2019.2.11f1 steps: - # Checkout repository (required to test local actions) - - name: Checkout repository + ########################### + # Checkout # + ########################### + - name: Checkout (default) uses: actions/checkout@v2 + if: github.event.event_type != 'pull_request_target' with: lfs: true + - name: Checkout (pull_request_target) + uses: actions/checkout@v2 + if: github.event.event_type == 'pull_request_target' + with: + lfs: true + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - # Enable caching + ########################### + # Cache # + ########################### - uses: actions/cache@v1.1.0 with: path: ${{ matrix.projectPath }}/Library @@ -181,6 +238,8 @@ jobs: unityVersion: ${{ matrix.unityVersion }} testMode: playmode artifactsPath: artifacts/playmode + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} # Upload artifacts - name: Upload test results @@ -201,13 +260,25 @@ jobs: projectPath: - unity-project-with-correct-tests steps: - # Checkout repository (required to test local actions) - - name: Checkout repository + ########################### + # Checkout # + ########################### + - name: Checkout (default) uses: actions/checkout@v2 + if: github.event.event_type != 'pull_request_target' with: lfs: true + - name: Checkout (pull_request_target) + uses: actions/checkout@v2 + if: github.event.event_type == 'pull_request_target' + with: + lfs: true + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - # Enable caching + ########################### + # Cache # + ########################### - uses: actions/cache@v1.1.0 with: path: ${{ matrix.projectPath }}/Library @@ -224,6 +295,8 @@ jobs: unityVersion: ${{ matrix.unityVersion }} testMode: editmode artifactsPath: artifacts/editmode + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} # Configure second test runner - name: Tests in playmode 📺 @@ -233,6 +306,8 @@ jobs: unityVersion: ${{ matrix.unityVersion }} testMode: playmode artifactsPath: artifacts/playmode + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} # Upload combined artifacts - name: Upload combined test results