From 032da52c8dfb553527dcc986265ceb388ab6cd22 Mon Sep 17 00:00:00 2001 From: Andrew Yang Date: Mon, 14 Oct 2024 13:36:04 +1100 Subject: [PATCH] init pipeline --- .github/workflows/build-test.yml | 70 ++++++++++++++++++++++++++++++++ .gitignore | 6 ++- 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-test.yml diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 00000000..fa274b26 --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,70 @@ +name: Build and test + +on: + pull_request: + branches: + - '**' + +jobs: + test: + name: Test my project 🧪 + runs-on: ubuntu-latest + steps: + # Checkout + - name: Checkout repository + uses: actions/checkout@v4 + with: + lfs: true + + # Cache + - uses: actions/cache@v3 + with: + path: Library + key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} + restore-keys: | + Library- + + # Test + - name: Run tests + uses: game-ci/unity-test-runner@v4 + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + with: + githubToken: ${{ secrets.GITHUB_TOKEN }} + + build: + name: Build my project ✨ + runs-on: ubuntu-latest + steps: + # Checkout + - name: Checkout repository + uses: actions/checkout@v4 + with: + lfs: true + + # Cache + - uses: actions/cache@v3 + with: + path: Library + key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} + restore-keys: | + Library- + + # Build + - name: Build project + uses: game-ci/unity-builder@v4 + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + with: + targetPlatform: StandaloneWindows64 + allowDirtyBuild: true + + # Output + - uses: actions/upload-artifact@v3 + with: + name: Build + path: build \ No newline at end of file diff --git a/.gitignore b/.gitignore index 30bea76f..86d38afe 100644 --- a/.gitignore +++ b/.gitignore @@ -82,4 +82,8 @@ crashlytics-build.properties .env -mono_crash.* \ No newline at end of file +mono_crash.* + +# Ignore temporaries from GameCI +/[Aa]rtifacts/ +/[Cc]odeCoverage/