首页 > 解决方案 > Github 操作将子模块排除在 .net 构建/测试之外

问题描述

我正在使用另一个 Git Repo 作为库,它使用不同的.net版本并且缺少在操作上构建的权限。我如何从构建中排除这个/所有子模块?

产生的错误代码:

error MSB3191: Unable to create directory "obj/Debug/". Access to the path '/home/runner/work/Repo/Project/Submodule/Folder/obj/Debug/' is denied.
error MSB3644: The reference assemblies for .NETFramework,Version=v2.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application...

工作流文件 (dotnet.yml)

name: .NET

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - uses: textbook/git-checkout-submodule-action@master
    - name: Setup .NET
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 5.0.x
    - name: Restore dependencies
      run: dotnet restore
    - name: Build
      run: dotnet build --no-restore
    - name: Test
      run: dotnet test --no-build --verbosity normal

标签: githubgithub-actions

解决方案


推荐阅读