.github/workflows/composite/build-test/action.yml

(完整代码) 1KB

name: "Build for PRe"
description: "Builds a docker image without pushing"

inputs:
  service:
    description: "Service to build"
    required: true
  registry_endpoint:
    description: "Image registry repo e.g. myacr.azureacr.io/eshop"
    required: true
  dotnet_version:
    description: "Version of dotnet to use for testing"
    required: true
  project_path:
    description: "Path to project to test e.g. Services/Catalog/Catalog.API"
    required: true
  tests_path:
    description: "Path to test project e.g. Services/Catalog/Catalog.UnitTests"
    required: true

runs:
  using: "composite"
  steps:
  - name: Setup dotnet
    uses: actions/setup-dotnet@v1
    with:
      dotnet-version: ${{ inputs.dotnet_version }}

  - name: Build and run unit tests
    shell: bash
    run: |
      cd src
      dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
      cd ${{ inputs.project_path }}
      dotnet build --no-restore
      cd -
      cd ${{ inputs.tests_path }}
      dotnet build --no-restore
      dotnet test --no-build -v=normal

  - name: Compose build ${{ inputs.service }}
    shell: bash
    run: sudo -E docker-compose build ${{ inputs.service }}
    working-directory: ./src
    env:
      TAG: ${{ env.BRANCH }}
      REGISTRY: ${{ inputs.registry_endpoint }}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。