From 8c46fe0e40c9f51e4cbea72b075890716376b13f Mon Sep 17 00:00:00 2001 From: Koji Hasegawa Date: Mon, 14 Oct 2024 15:18:52 +0900 Subject: [PATCH 1/7] Mod dependency check interval to weekly --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 253bcb7..ca79ca5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,4 +3,4 @@ updates: - package-ecosystem: github-actions directory: / schedule: - interval: daily + interval: weekly From 2a086c19cf1171598e40edbd587301c3138b353b Mon Sep 17 00:00:00 2001 From: Koji Hasegawa Date: Mon, 14 Oct 2024 15:30:36 +0900 Subject: [PATCH 2/7] Add timeout-minutes --- .github/workflows/actionlint.yml | 1 + .github/workflows/create-release-pr.yml | 1 + .github/workflows/metacheck.yml | 1 + .github/workflows/pr-labeler.yml | 1 + .github/workflows/release-drafter.yml | 1 + .github/workflows/release.yml | 2 ++ .github/workflows/test.yml | 2 ++ 7 files changed, 9 insertions(+) diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml index c0e07ae..a83f08b 100644 --- a/.github/workflows/actionlint.yml +++ b/.github/workflows/actionlint.yml @@ -17,6 +17,7 @@ on: jobs: actionlint: runs-on: ubuntu-latest + timeout-minutes: 5 permissions: contents: read actions: read diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index a7f6d7a..c695b0f 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -10,6 +10,7 @@ on: jobs: create-release-pr: runs-on: ubuntu-latest + timeout-minutes: 5 permissions: contents: write pull-requests: write diff --git a/.github/workflows/metacheck.yml b/.github/workflows/metacheck.yml index d168962..d1fe6c0 100644 --- a/.github/workflows/metacheck.yml +++ b/.github/workflows/metacheck.yml @@ -13,6 +13,7 @@ on: jobs: meta-check: runs-on: ubuntu-latest + timeout-minutes: 5 permissions: contents: read actions: read diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml index 9ab41f0..724bcdc 100644 --- a/.github/workflows/pr-labeler.yml +++ b/.github/workflows/pr-labeler.yml @@ -11,6 +11,7 @@ jobs: pr-labeler: if: github.event.pull_request.head.repo.fork == false # Skip on public fork runs-on: ubuntu-latest + timeout-minutes: 5 permissions: contents: read pull-requests: write diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 694e384..df560b4 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -17,6 +17,7 @@ jobs: release-drafter: if: github.repository_owner == 'nowsprinting' # Skip on forked repo runs-on: ubuntu-latest + timeout-minutes: 5 permissions: contents: write pull-requests: read diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e63461a..5312dcf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,7 @@ jobs: check-bump-version: if: github.repository_owner == 'nowsprinting' # Skip on forked repo runs-on: ubuntu-latest + timeout-minutes: 5 permissions: contents: read outputs: @@ -34,6 +35,7 @@ jobs: needs: check-bump-version if: ${{ needs.check-bump-version.outputs.new-version }} runs-on: ubuntu-latest + timeout-minutes: 5 permissions: contents: write pull-requests: read diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 039915b..1735afa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,6 +26,7 @@ jobs: test: if: github.event.pull_request.head.repo.fork == false # Skip on public fork, because can not read secrets. runs-on: ubuntu-latest + timeout-minutes: 15 permissions: contents: read checks: write @@ -123,6 +124,7 @@ jobs: needs: test if: github.event.pull_request.head.repo.fork == false # Skip on public fork, because can not read secrets. runs-on: ubuntu-latest + timeout-minutes: 5 permissions: actions: read From 88f6df77a454959ebfedd7cacc9cb71771f72930 Mon Sep 17 00:00:00 2001 From: Koji Hasegawa Date: Mon, 14 Oct 2024 15:33:49 +0900 Subject: [PATCH 3/7] Add github.ref into cache key --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1735afa..1140f7a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,9 +51,11 @@ jobs: - uses: actions/cache@v4 with: path: ${{ env.CREATED_PROJECT_PATH }}/Library - key: Library-${{ matrix.unityVersion }} + key: Library-linux-${{ matrix.unityVersion }}-${{ github.ref }} restore-keys: | - Library- + Library-linux-${{ matrix.unityVersion }} + Library-linux + Library - name: Get package checkout path run: | From 54495413c08d4c705742467dd415a72a599e4c3c Mon Sep 17 00:00:00 2001 From: Koji Hasegawa Date: Mon, 14 Oct 2024 15:38:30 +0900 Subject: [PATCH 4/7] Add `@stable` virtual dist-tag when installing test-framework package After July 2024, specifying the `@latest` dist-tag (default) will install the test-framework package v2. `@stable` virtual dist-tag is support from opeupm-cli v4.3.0 or later. see: https://github.com/openupm/openupm-cli/issues/395 --- .github/workflows/test.yml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1140f7a..eb8761c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -74,7 +74,7 @@ jobs: - name: Install dependencies run: | npm install -g openupm-cli - openupm add -f com.unity.test-framework + openupm add -f com.unity.test-framework@stable openupm add -f com.unity.testtools.codecoverage working-directory: ${{ env.CREATED_PROJECT_PATH }} diff --git a/Makefile b/Makefile index 642cda9..337b439 100644 --- a/Makefile +++ b/Makefile @@ -122,7 +122,7 @@ create_project: -batchmode \ -quit touch UnityProject~/Assets/.gitkeep - openupm -c $(PROJECT_HOME) add -f com.unity.test-framework + openupm -c $(PROJECT_HOME) add -f com.unity.test-framework@stable openupm -c $(PROJECT_HOME) add -f com.unity.testtools.codecoverage openupm -c $(PROJECT_HOME) add -ft $(PACKAGE_NAME)@file:../../ From afd611501f0ff323437bee31c9a563a028d248be Mon Sep 17 00:00:00 2001 From: Koji Hasegawa Date: Mon, 14 Oct 2024 15:41:14 +0900 Subject: [PATCH 5/7] Mod openupm command option `-c` option has been changed from global to local option of add/remove subcommands. see: https://github.com/openupm/openupm-cli/discussions/408 --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 337b439..66398af 100644 --- a/Makefile +++ b/Makefile @@ -121,10 +121,10 @@ create_project: -createProject $(PROJECT_HOME) \ -batchmode \ -quit - touch UnityProject~/Assets/.gitkeep - openupm -c $(PROJECT_HOME) add -f com.unity.test-framework@stable - openupm -c $(PROJECT_HOME) add -f com.unity.testtools.codecoverage - openupm -c $(PROJECT_HOME) add -ft $(PACKAGE_NAME)@file:../../ + touch $(PROJECT_HOME)/Assets/.gitkeep + openupm add -c $(PROJECT_HOME) -f com.unity.test-framework@stable + openupm add -c $(PROJECT_HOME) -f com.unity.testtools.codecoverage + openupm add -c $(PROJECT_HOME) -ft $(PACKAGE_NAME)@file:../../ .PHONY: remove_project remove_project: From 52160b2217e5248f867bc84cd0f1f9e4a4af229c Mon Sep 17 00:00:00 2001 From: Koji Hasegawa Date: Mon, 14 Oct 2024 15:46:30 +0900 Subject: [PATCH 6/7] Mod log file names to same to game-ci/unity-test-runner --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 66398af..55d1752 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ endif define base_arguments -projectPath $(PROJECT_HOME) \ --logFile $(LOG_DIR)/test_$(TEST_PLATFORM).log +-logFile $(LOG_DIR)/$(TEST_PLATFORM).log endef define test_arguments @@ -64,7 +64,9 @@ $(TEST_CATEGORY) \ $(TEST_FILTER) \ $(ASSEMBLY_NAMES) \ -testPlatform $(TEST_PLATFORM) \ --testResults $(LOG_DIR)/test_$(TEST_PLATFORM)_results.xml +-testResults $(LOG_DIR)/$(TEST_PLATFORM)-results.xml \ +-testHelperJUnitResults $(LOG_DIR)/$(TEST_PLATFORM)-junit-results.xml \ +-testHelperScreenshotDirectory $(LOG_DIR)/Screenshots endef define test From 1045e4e4fe088e95cf8947d27d6f0568df14b756 Mon Sep 17 00:00:00 2001 From: Koji Hasegawa Date: Mon, 14 Oct 2024 15:48:24 +0900 Subject: [PATCH 7/7] Fix to code coverage exclude test project assemblies --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 55d1752..e2fdff9 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ PACKAGE_NAME?=$(shell grep -o -E '"name": "(.+)"' $(PACKAGE_HOME)/package.json | # Code Coverage report filter (comma separated) # see: https://docs.unity3d.com/Packages/com.unity.testtools.codecoverage@1.2/manual/CoverageBatchmode.html -PACKAGE_ASSEMBLIES?=$(shell echo $(shell find $(PACKAGE_HOME) -name "*.asmdef" -maxdepth 3 | sed -e s/.*\\//\+/ | sed -e s/\\.asmdef// | sed -e s/^.*\\.Tests//) | sed -e s/\ /,/g) +PACKAGE_ASSEMBLIES?=$(shell echo $(shell find $(PACKAGE_HOME) -name "*.asmdef" | grep -v -E "\/UnityProject~\/" | sed -e s/.*\\//\+/ | sed -e s/\\.asmdef// | sed -e s/^.*\\.Tests//) | sed -e s/\ /,/g) COVERAGE_ASSEMBLY_FILTERS?=$(PACKAGE_ASSEMBLIES),+,-*.Tests # -nographics` option