Skip to content

Commit

Permalink
Merge pull request #90 from hadashiA/ku/fix-ci
Browse files Browse the repository at this point in the history
Fix CI
  • Loading branch information
hadashiA authored Jan 15, 2021
2 parents 4583b84 + 08fd310 commit 9e75a81
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 53 deletions.
43 changes: 23 additions & 20 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ${{ 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
- 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
Expand All @@ -43,8 +47,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Ver.${{ github.ref }}
draft: true
release_name: v${{ github.ref }}

# Download(All) Artifacts to current directory
- uses: actions/download-artifact@v2-preview
Expand Down
68 changes: 42 additions & 26 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,45 @@ 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:
- 2020.1.13f1
# - 2019.4.14f1
scriptBackend: ['mono']
include:
- unityVersion: 2020.1.13f1
license: UNITY_LICENSE_2020_1_BASE64
# - unityVersion: 2019.4.14f1
# license: UNITY_LICENSE_2019_4_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-${{ matrix.unityVersion }}
- 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 -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
path: ./VContainer/tmp/TestResults.xml
14 changes: 7 additions & 7 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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
"

1 comment on commit 9e75a81

@vercel
Copy link

@vercel vercel bot commented on 9e75a81 Jan 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.