Add tests CI/CD
This commit is contained in:
+26
-11
@@ -1,9 +1,7 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
push
|
||||
|
||||
env:
|
||||
PLUGIN_REPO: WorkingRobot/MyDalamudPlugins
|
||||
@@ -12,6 +10,8 @@ env:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
env:
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT: true
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -20,34 +20,49 @@ jobs:
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup MSBuild
|
||||
uses: microsoft/setup-msbuild@v1.0.3
|
||||
uses: microsoft/setup-msbuild@v1
|
||||
|
||||
- name: Download Dalamud
|
||||
run: |
|
||||
Invoke-WebRequest -Uri https://goatcorp.github.io/dalamud-distrib/stg/latest.zip -OutFile latest.zip
|
||||
Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev\"
|
||||
|
||||
- name: Build
|
||||
- name: Restore
|
||||
run: |
|
||||
dotnet restore -r win ${{env.PROJECT_NAME}}.sln
|
||||
dotnet build --configuration Release
|
||||
env:
|
||||
DOTNET_CLI_TELEMETRY_OUTPUT: true
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v2.2.1
|
||||
- name: Build
|
||||
run: |
|
||||
dotnet build --configuration Release
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
dotnet test --configuration Release --logger "trx;logfilename=results.trx" --logger "html;logfilename=results.html" --logger "console;verbosity=detailed" --results-directory="TestResults"
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{env.PROJECT_NAME}}
|
||||
path: ${{env.PROJECT_NAME}}/bin/x64/Release/${{env.PROJECT_NAME}}
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload Test Results
|
||||
uses: actions/upload-artifact@v3
|
||||
if: ${{ always() }}
|
||||
with:
|
||||
name: ${{env.PROJECT_NAME}}
|
||||
path: TestResults
|
||||
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
id: release
|
||||
with:
|
||||
files: ${{env.PROJECT_NAME}}/bin/x64/Release/${{env.PROJECT_NAME}}/*
|
||||
|
||||
- name: Trigger Plugin Repo Update
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
uses: peter-evans/repository-dispatch@v2
|
||||
if: ${{ steps.release.conclusion == 'success' }}
|
||||
with:
|
||||
token: ${{secrets.PAT}}
|
||||
repository: ${{env.PLUGIN_REPO}}
|
||||
|
||||
Reference in New Issue
Block a user