From e3660dd2cbcd921810856cadb45dc954dbe82e20 Mon Sep 17 00:00:00 2001 From: alexiscatnip Date: Fri, 8 Jul 2022 20:28:48 +0800 Subject: [PATCH] add test and build automation (workflow) --- .github/workflows/main.yml | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..401412e --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,46 @@ +name: Actions 😎 + +on: + pull_request: {} + push: { branches: [main, develop] } + +jobs: + readmeWorkflow: + name: Readme Workflow ✨ + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Restore Library cache + - uses: actions/cache@v2 + with: + path: Library + key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} + restore-keys: | + Library- + + # Test + - name: Run tests + uses: game-ci/unity-test-runner@v2 + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + with: + githubToken: ${{ secrets.GITHUB_TOKEN }} + + # Build + - name: Build project + uses: game-ci/unity-builder@v2 + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + with: + targetPlatform: StandaloneWindows64 + targetPlatform: Android + + # Output + - uses: actions/upload-artifact@v2 + with: + name: Build + path: build