Skip to content

Commit

Permalink
Add Template CI Github Workflow (#13)
Browse files Browse the repository at this point in the history
This PR adds a github workflow that will attempt to create projects from the templates in all supported dotnet SDK versions (6, 7, & 8) when a push to any branch or a PR is made (if the action is approved to run).

This acts as two checks. The first, to make sure templates can be used at all. The second, to make sure templates can be used in all of the supported SDK versions.
  • Loading branch information
Xilophor authored Feb 18, 2024
1 parent 83a8749 commit c5fac75
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/actions/dryrun-templates/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
runs:
using: "composite"
steps:
- name: Install Templates
run: |
dotnet new --install ./BepInEx.Templates/templates/
shell: bash

- name: Test BepInEx5 Template
if: always()
run: |
dotnet new bepinex5plugin --dry-run --diagnostics
shell: bash

- name: Test BepInEx6 .NET Core Template
if: always()
run: |
dotnet new bep6plugin_coreclr --dry-run --diagnostics
shell: bash

- name: Test BepInEx6 .NET Framework Template
if: always()
run: |
dotnet new bep6plugin_netfx --dry-run --diagnostics
shell: bash

- name: Test BepInEx6 Unity IL2CPP Template
if: always()
run: |
dotnet new bep6plugin_unity_il2cpp --dry-run --diagnostics
shell: bash

- name: Test BepInEx6 Unity Mono Template
if: always()
run: |
dotnet new bep6plugin_unity_mono --dry-run --diagnostics
shell: bash
63 changes: 63 additions & 0 deletions .github/workflows/verify-templates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Verify Templates

on:
push:
pull_request:

jobs:
test-sdk6:
name: Test .NET SDK 6
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v4

- name: Setup .NET env
uses: actions/setup-dotnet@v4
id: setup-dotnet
with:
dotnet-version: 6.x

- run: |
dotnet new globaljson --sdk-version ${{ steps.setup-dotnet.outputs.dotnet-version }}
- name: Dry-run Templates
uses: ./.github/actions/dryrun-templates

test-sdk7:
name: Test .NET SDK 7
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v4

- name: Setup .NET env
uses: actions/setup-dotnet@v4
id: setup-dotnet
with:
dotnet-version: 7.x

- run: |
dotnet new globaljson --sdk-version ${{ steps.setup-dotnet.outputs.dotnet-version }}
- name: Dry-run Templates
uses: ./.github/actions/dryrun-templates

test-sdk8:
name: Test .NET SDK 8
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v4

- name: Setup .NET env
uses: actions/setup-dotnet@v4
id: setup-dotnet
with:
dotnet-version: 8.x

- run: |
dotnet new globaljson --sdk-version ${{ steps.setup-dotnet.outputs.dotnet-version }}
- name: Dry-run Templates
uses: ./.github/actions/dryrun-templates

0 comments on commit c5fac75

Please sign in to comment.