Skip to content

Commit 2460525

Browse files
committed
Add CI
1 parent 5e2f733 commit 2460525

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

.github/workflows/main.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Test
2+
3+
on:
4+
pull_request: {}
5+
push: {}
6+
7+
# env:
8+
# UNITY_LICENSE_FILE: UnityLicense/2019.2.11f1.ulf
9+
10+
jobs:
11+
Test:
12+
name: Test ${{ matrix.unityVersion }} ${{ matrix.testMode }} 🔑
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
unityVersion:
18+
- 2018.4.17f1
19+
- 2019.4.9f1
20+
- 2020.1.3f1
21+
steps:
22+
# Set env
23+
- name: Set env UNITY_LICENSE_FILE
24+
run: echo "UNITY_LICENSE_FILE=UnityLicense/${{ matrix.unityVersion }}.ulf" >> $GITHUB_ENV
25+
26+
# Checkout Empty Project
27+
- name: Checkout Empty Project
28+
uses: actions/checkout@v2
29+
with:
30+
repository: litefeel/UnityEmptyProject
31+
32+
# Checkout this project
33+
- name: Checkout repository
34+
uses: actions/checkout@v2
35+
with:
36+
lfs: true
37+
path: Packages/MyPlugin
38+
39+
# Cache
40+
- uses: actions/cache@v2
41+
with:
42+
path: Library
43+
key: Library
44+
45+
# Test
46+
- name: Run tests
47+
uses: webbertakken/[email protected]
48+
id: tests
49+
with:
50+
customParameters: "-nographics"
51+
unityVersion: ${{ matrix.unityVersion }}
52+
53+
# # Build
54+
# - name: Build project
55+
# uses: litefeel/[email protected]
56+
# with:
57+
# unityVersion: ${{ matrix.unityVersion }}
58+
# targetPlatform: WebGL
59+
60+
# Output
61+
- uses: actions/upload-artifact@v1
62+
name: Upload tests
63+
with:
64+
name: Test results for ${{ matrix.testMode }} on unity ${{ matrix.unityVersion }}
65+
path: ${{ steps.tests.outputs.artifactsPath }}
66+
67+
# - uses: actions/upload-artifact@v1
68+
# name: Upload build
69+
# with:
70+
# name: Build
71+
# path: build

.github/workflows/npm-publish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# https://github.com/marketplace/actions/publish-to-npm
2+
3+
name: npm-publish
4+
on:
5+
push:
6+
branches:
7+
- master # Change this to your default branch
8+
jobs:
9+
npm-publish:
10+
name: npm-publish
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@master
15+
- name: Set up Node.js
16+
uses: actions/setup-node@master
17+
with:
18+
node-version: 10.0.0
19+
- name: Publish if version has been updated
20+
uses: pascalgn/npm-publish-action@06e0830ea83eea10ed4a62654eeaedafb8bf50fc
21+
with: # All of theses inputs are optional
22+
tag_name: "%s"
23+
tag_message: "%s"
24+
commit_pattern: "^Release (\\S+)"
25+
workspace: "."
26+
env: # More info about the environment variables in the README
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated
28+
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # You need to set this in your repo settings

0 commit comments

Comments
 (0)