Use hurl for integration tests #10
Workflow file for this run
This file contains 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
name: "Backend Tests" | |
on: | |
pull_request: | |
paths: | |
- 'src/api/**' | |
- '.github/workflows/pr-api.yml' | |
jobs: | |
api-test: | |
name: Test API | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dotnet-version: ['6.0.x'] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install hurl | |
uses: gacts/install-hurl@v1.0.3 | |
with: | |
version: 4.0.0 | |
- name: Start Docker containers | |
working-directory: . | |
run: docker-compose --project-directory . -f env/local/docker-compose.local.yml up -d | |
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }} | |
uses: actions/setup-dotnet@v1.7.2 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.nuget/packages | |
# Look to see if there is a cache hit for the corresponding requirements file | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-nuget | |
- name: Display dotnet version | |
run: dotnet --version | |
- name: Install dependencies | |
working-directory: ./src/api | |
run: dotnet restore | |
- name: Build | |
working-directory: ./src/api | |
run: dotnet build --no-restore | |
- name: Run tests | |
working-directory: ./src/api | |
run: dotnet test --verbosity normal | |
- name: Run integration tests | |
run: hurl --test integrations/**/*.hurl | |
- name: Stop Docker containers | |
if: always() | |
working-directory: . | |
run: docker-compose --project-directory . -f env/local/docker-compose.local.yml down |