Skip to content

Commit

Permalink
Merge pull request #52 from nowsprinting/chore/fix_workflows
Browse files Browse the repository at this point in the history
Fix workflows
  • Loading branch information
nowsprinting authored Oct 14, 2024
2 parents 350f50b + 9c50032 commit de30891
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
interval: weekly
1 change: 1 addition & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
jobs:
actionlint:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
actions: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
jobs:
create-release-pr:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: write
pull-requests: write
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/metacheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
jobs:
meta-check:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
actions: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -50,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: |
Expand All @@ -71,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 }}

Expand Down Expand Up @@ -123,6 +126,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

Expand Down
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]/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),+<assets>,-*.Tests

# -nographics` option
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -121,10 +123,10 @@ create_project:
-createProject $(PROJECT_HOME) \
-batchmode \
-quit
touch UnityProject~/Assets/.gitkeep
openupm -c $(PROJECT_HOME) add -f com.unity.test-framework
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:
Expand Down

0 comments on commit de30891

Please sign in to comment.