You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.3 KiB

  1. name: "Build for PRe"
  2. description: "Builds a docker image without pushing"
  3. inputs:
  4. service:
  5. description: "Service to build"
  6. required: true
  7. registry_endpoint:
  8. description: "Image registry repo e.g. myacr.azureacr.io/eshop"
  9. required: true
  10. dotnet_version:
  11. description: "Version of dotnet to use for testing"
  12. required: true
  13. project_path:
  14. description: "Path to project to test e.g. Services/Catalog/Catalog.API"
  15. required: true
  16. tests_path:
  17. description: "Path to test project e.g. Services/Catalog/Catalog.UnitTests"
  18. required: true
  19. runs:
  20. using: "composite"
  21. steps:
  22. - name: Setup dotnet
  23. uses: actions/setup-dotnet@v1
  24. with:
  25. dotnet-version: ${{ inputs.dotnet_version }}
  26. - name: Build and run unit tests
  27. shell: bash
  28. run: |
  29. cd src
  30. dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
  31. cd ${{ inputs.project_path }}
  32. dotnet build --no-restore
  33. cd -
  34. cd ${{ inputs.tests_path }}
  35. dotnet build --no-restore
  36. dotnet test --no-build -v=normal
  37. - name: Compose build ${{ inputs.service }}
  38. shell: bash
  39. run: sudo -E docker-compose build ${{ inputs.service }}
  40. working-directory: ./src
  41. env:
  42. TAG: ${{ env.BRANCH }}
  43. REGISTRY: ${{ inputs.registry_endpoint }}