From cdd55c0730b6ca6442001b69bb612c708375885b Mon Sep 17 00:00:00 2001 From: hadashiA Date: Sat, 14 Nov 2020 18:46:19 +0900 Subject: [PATCH 1/3] ci --- .github/workflows/release.yaml | 41 ++++++++++---------- .github/workflows/test.yaml | 69 +++++++++++++++++++++------------- 2 files changed, 65 insertions(+), 45 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2a687c30..e30f7b30 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,39 +2,43 @@ name: Release on: push: - tags: - - "[0-9]+.[0-9]+.[0-9]+*" - + tags: ["[0-9]+.[0-9]+.[0-9]+*"] + branches: ['release-test'] jobs: build-unity: runs-on: ubuntu-latest + env: + UNITY_LICENSE_FILE: ./tmp/ulf + UNITY_BIN: /opt/Unity/Editor/Unity + container: + image: gableroux/unity3d:2019.4.14f1-linux-il2cpp steps: - uses: actions/checkout@v2 + - name: Decode Unity License File + run: | + mkdir ./tmp + echo -n $UNITY_LICENSE_2019_BASE64 | base64 --decode > $UNITY_LICENSE_FILE + - run: $UNITY_BIN -quit -batchmode -nographics -silent-crashes -logFile -manualLicenseFile $UNITY_LICENSE_FILE || exit 0 + # set release tag(*.*.*) to env.GIT_TAG - - run: echo ::set-env name=GIT_TAG::${GITHUB_REF#refs/tags/} - - name: Create meta list + - run: echo "name=GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + # Execute scripts: Export Package + - name: Export unitypackage + run: $UNITY_BIN -batchmode -nographics -logFile /dev/stdout -exportPackage Assets/VContainer/Runtime Assets/VContainer/Editor VContainer.${{ env.GIT_TAG }}.unitypackage -projectPath ./VContainer working-directory: VContainer - run: | - echo Assets/VContainer.meta >> metaList - echo Assets/VContainer/Runtime.meta >> metaList - find Assets/VContainer/Runtime -name \*.meta >> metaList - echo Assets/VContainer/Editor.meta >> metaList - find Assets/VContainer/Editor -name \*.meta >> metaList - - uses: pCYSl5EDgo/create-unitypackage@master - with: - package-path: VContainer.${{ env.GIT_TAG }}.unitypackage - include-files: VContainer/metaList - project-folder: ./VContainer + + # Store artifacts. - uses: actions/upload-artifact@v2 with: - path: VContainer.${{ env.GIT_TAG }}.unitypackage name: VContainer.${{ env.GIT_TAG }}.unitypackage + path: ./VContainer/VContainer.${{ env.GIT_TAG }}.unitypackage create-release: needs: [build-unity] runs-on: ubuntu-latest steps: - - run: echo ::set-env name=GIT_TAG::${GITHUB_REF#refs/tags/} + - run: echo "name=GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV # Create Releases - uses: actions/create-release@v1 @@ -44,7 +48,6 @@ jobs: with: tag_name: ${{ github.ref }} release_name: Ver.${{ github.ref }} - draft: true # Download(All) Artifacts to current directory - uses: actions/download-artifact@v2-preview diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a6fde9da..c2cc97c3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,29 +16,46 @@ jobs: dotnet-version: 3.1.101 - run: dotnet test -c Debug ./VContainer.StandaloneTests - # test-unity: - # runs-on: ubuntu-latest - # strategy: - # matrix: - # unity: ['2019.4.1f1'] - # include: - # - unity: 2019.4.1f1 - # license: UNITY_LISENCE_2019_4_BASE64 - # container: - # image: gableroux/unity3d:${{ matrix.unity }}-linux-il2cpp - # env: - # UNITY_BIN: /opt/Unity/Editor/Unity - # steps: - # - uses: actions/checkout@v2 - # - name: Decode Unity License File - # run: | - # mkdir ./tmp - # echo -n $UNITY_LICENSE_FILE_BASE64 | base64 --decode > ./tmp/ulf - # env: - # UNITY_LICENSE_FILE_BASE64: ${{ secrets[matrix.license] }} - # - name: Load License - # run: $UNITY_BIN -quit -batchmode -nographics -silent-crashes -logFile -manualLicenseFile ./tmp/ulf || exit 0 - # - name: Run Tests - # run: $UNITY_BIN -runTests -quit -batchmode -silent-crashes -nographics -silent-crashes -logFile -projectPath ./VContainer -testResults ./tmp/TestResults.xml -testPlatform StandaloneLinux64 -scriptbackend=mono - # - name: Run Performance Tests - # run: $UNITY_BIN -runTests -batchmode -nographics -projectPath ./VContainer.Benchmark -testResults tmp/PerformanceTestResults.xml -testPlatform StandaloneLinux64 -script -scriptbackend=mono + test-unity: + runs-on: ubuntu-latest + env: + UNITY_LICENSE_FILE: ./tmp/ulf + # UNITY_BIN: xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' /opt/Unity/Editor/Unity + UNITY_BIN: /opt/Unity/Editor/Unity + strategy: + matrix: + unityVersion: ['2019.4.14f1'] + scriptBackend: ['mono'] + include: + - unityVersion: 2019.4.14f1 + license: UNITY_LICENSE_2019_BASE64 + # - unityVersion: 2020.1.12f1 + # license: UNITY_LICENSE_2020_BASE64 + container: + image: gableroux/unity3d:${{ matrix.unityVersion }}-linux-il2cpp + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: VContainer/Library + key: Library-VContainer + restore-keys: | + Library-VContainer- + Library- + - name: Dump unity license file + shell: bash + run: | + mkdir ./tmp + mkdir ./VContainer/tmp + chmod 777 ./VContainer/tmp + echo -n "${{ secrets[matrix.license] }}" | base64 --decode > $UNITY_LICENSE_FILE + - name: Load License + shell: bash + run: $UNITY_BIN -quit -batchmode -nographics -silent-crashes -logFile /dev/stdout -manualLicenseFile $UNITY_LICENSE_FILE || exit 0 + - name: Run Tests + shell: bash + run: $UNITY_BIN -batchmode -nographics -silent-crashes -logFile /dev/stdout -projectPath ./VContainer -runTests -testResults $GITHUB_WORKSPACE/VContainer/tmp/TestResults.xml -testPlatform playmode -buildTarget StandaloneLinux64 -scriptbackend=${{ matrix.scriptBackend }} + - uses: actions/upload-artifact@v1 + with: + name: Test results + path: ./VContainer/tmp/TestResults.xml From f2820188b66012f6438eef11ee24944c6bec7a60 Mon Sep 17 00:00:00 2001 From: hadashiA Date: Sat, 9 Jan 2021 15:08:20 +0900 Subject: [PATCH 2/3] ci --- .github/workflows/test.yaml | 10 +++++----- docker-compose.yaml | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c2cc97c3..2ae84022 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -24,11 +24,11 @@ jobs: UNITY_BIN: /opt/Unity/Editor/Unity strategy: matrix: - unityVersion: ['2019.4.14f1'] + unityVersion: ['2020.1.13f1'] scriptBackend: ['mono'] include: - - unityVersion: 2019.4.14f1 - license: UNITY_LICENSE_2019_BASE64 + - unityVersion: 2020.1.13f1 + license: UNITY_LICENSE_2020_1_BASE64 # - unityVersion: 2020.1.12f1 # license: UNITY_LICENSE_2020_BASE64 container: @@ -38,7 +38,7 @@ jobs: - uses: actions/cache@v2 with: path: VContainer/Library - key: Library-VContainer + key: Library-VContainer2 restore-keys: | Library-VContainer- Library- @@ -54,7 +54,7 @@ jobs: run: $UNITY_BIN -quit -batchmode -nographics -silent-crashes -logFile /dev/stdout -manualLicenseFile $UNITY_LICENSE_FILE || exit 0 - name: Run Tests shell: bash - run: $UNITY_BIN -batchmode -nographics -silent-crashes -logFile /dev/stdout -projectPath ./VContainer -runTests -testResults $GITHUB_WORKSPACE/VContainer/tmp/TestResults.xml -testPlatform playmode -buildTarget StandaloneLinux64 -scriptbackend=${{ matrix.scriptBackend }} + run: $UNITY_BIN -batchmode -logFile /dev/stdout -projectPath ./VContainer -runTests -testResults $GITHUB_WORKSPACE/VContainer/tmp/TestResults.xml -testPlatform playmode -buildTarget StandaloneLinux64 -scriptbackend=${{ matrix.scriptBackend }} -nographics -silent-crashes - uses: actions/upload-artifact@v1 with: name: Test results diff --git a/docker-compose.yaml b/docker-compose.yaml index 12303c9a..61a339ac 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,28 +1,28 @@ version: '3' services: alf: - image: gableroux/unity3d:2019.4.0f1 + image: gableroux/unity3d:2020.1.13f1-linux-il2cpp volumes: - .:/VContainer working_dir: /VContainer/tmp command: /opt/Unity/Editor/Unity -quit -batchmode -nographics -logFile -createManualActivationFile test: - image: gableroux/unity3d:2019.4.0f1 + image: gableroux/unity3d:2020.1.13f1-linux-il2cpp volumes: - .:/VContainer working_dir: /VContainer command: > /bin/sh -c " - /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -manualLicenseFile ./tmp/Unity_v2019.4.0f1.ulf || - /opt/Unity/Editor/Unity -runTests -batchmode -nographics -logFile -projectPath ./VContainer -testResults ./tmp/TestResults.xml -testPlatform StandaloneLinux64 -buildTarget StandaloneLinux64 -scriptbackend=mono + /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -manualLicenseFile ./tmp/Unity_v2020.1.ulf || + /opt/Unity/Editor/Unity -runTests -batchmode -nographics -logFile ./tmp/log -projectPath ./VContainer -testResults ./tmp/TestResults.xml -testPlatform playmode -buildTarget StandaloneLinux64 -scriptbackend=mono " performance-test: - image: gableroux/unity3d:2019.4.0f1 + image: gableroux/unity3d:2020.1.13f1-linux-il2cpp volumes: - .:/VContainer working_dir: /VContainer command: > /bin/sh -c " - /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -manualLicenseFile ./tmp/Unity_v2019.4.0f1.ulf || - /opt/Unity/Editor/Unity -runTests -batchmode -nographics -projectPath ./VContainer.Benchmark -testResults tmp/PerformanceTestResults-linux.xml -testPlatform StandaloneLinux64 -buildTarget StandaloneLinux64 -scriptbackend=il2cpp + /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -manualLicenseFile ./tmp/Unity_v2020.1.ulf || + /opt/Unity/Editor/Unity -runTests -batchmode -nographics -silent-crashes -logFile ./tmp/log -projectPath ./VContainer.Benchmark -testResults tmp/PerformanceTestResults.xml -buildTarget StandaloneLinux64 -scriptbackend=il2cpp " From 08fd310aad2d7d24be8996279fe644783182ad23 Mon Sep 17 00:00:00 2001 From: hadashiA Date: Thu, 14 Jan 2021 21:50:40 +0900 Subject: [PATCH 3/3] Add matrix test --- .github/workflows/release.yaml | 4 ++-- .github/workflows/test.yaml | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e30f7b30..dd012002 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,7 +17,7 @@ jobs: - name: Decode Unity License File run: | mkdir ./tmp - echo -n $UNITY_LICENSE_2019_BASE64 | base64 --decode > $UNITY_LICENSE_FILE + echo -n ${{ secrets.UNITY_LICENSE_2020_1_BASE64 }} | base64 --decode > $UNITY_LICENSE_FILE - run: $UNITY_BIN -quit -batchmode -nographics -silent-crashes -logFile -manualLicenseFile $UNITY_LICENSE_FILE || exit 0 # set release tag(*.*.*) to env.GIT_TAG @@ -47,7 +47,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref }} - release_name: Ver.${{ github.ref }} + release_name: v${{ github.ref }} # Download(All) Artifacts to current directory - uses: actions/download-artifact@v2-preview diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2ae84022..fbf62075 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -24,13 +24,15 @@ jobs: UNITY_BIN: /opt/Unity/Editor/Unity strategy: matrix: - unityVersion: ['2020.1.13f1'] + unityVersion: + - 2020.1.13f1 + # - 2019.4.14f1 scriptBackend: ['mono'] include: - unityVersion: 2020.1.13f1 license: UNITY_LICENSE_2020_1_BASE64 - # - unityVersion: 2020.1.12f1 - # license: UNITY_LICENSE_2020_BASE64 + # - unityVersion: 2019.4.14f1 + # license: UNITY_LICENSE_2019_4_BASE64 container: image: gableroux/unity3d:${{ matrix.unityVersion }}-linux-il2cpp steps: @@ -38,10 +40,7 @@ jobs: - uses: actions/cache@v2 with: path: VContainer/Library - key: Library-VContainer2 - restore-keys: | - Library-VContainer- - Library- + key: Library-VContainer-${{ matrix.unityVersion }} - name: Dump unity license file shell: bash run: |