Merge branch 'master' into develop #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy | |
# More GitHub Actions for Azure: https://github.com/Azure/actions | |
name: Build and test | |
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
branches: | |
- '*' | |
workflow_dispatch: | |
env: | |
AZURE_WEBAPP_NAME: 'auto-hub-app' # set this to your application's name | |
AZURE_WEBAPP_PACKAGE_PATH: './publish' # set this to the path to your web app project, defaults to the repository root | |
DOTNET_VERSION: '8.x' # set this to the dot net version to use | |
jobs: | |
build: | |
name: Build | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Build with dotnet | |
run: dotnet build --configuration Release | |
- name: Publish artifact | |
run: dotnet publish -c Release -o ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.AZURE_WEBAPP_NAME }} | |
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} | |
test: | |
name: Test | |
runs-on: windows-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Build with dotnet | |
run: dotnet build --configuration Release | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Run tests with dotnet | |
run: dotnet test --no-build --no-restore --configuration Release |