Add Goob #88
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: build_and_test.yml | |
on: | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
Solution_Name: ReplayBrowser.sln | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: ReplayBrowser | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
# SETUP | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Seed database | |
run: PGPASSWORD='postgres' psql -h localhost -U postgres -d ReplayBrowser -f ./Tools/replaybrowser_ci_seed.sql | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
- name: Verify .NET Core version | |
run: dotnet --version | |
- name: Install dotnet-ef | |
run: dotnet tool install --global dotnet-ef | |
- name: Verify dotnet-ef version | |
run: dotnet ef --version | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install playwright | |
playwright install | |
- name: Restore NuGet Packages | |
run: dotnet restore ./ReplayBrowser/ReplayBrowser.csproj | |
- name: Write appsettings.Secret.json file # This file is used to store the connection string for the database | |
run: echo "{\"ConnectionStrings\":{\"DefaultConnection\":\"Host=localhost;Port=5432;Database=ReplayBrowser;Username=postgres;Password=postgres\"}}" > ./ReplayBrowser/appsettings.Secret.json | |
# BUILD AND TEST | |
- name: Build Solution | |
run: dotnet build ./ReplayBrowser/ReplayBrowser.csproj --no-restore --configuration Testing | |
- name: Check pending migrations | |
run: python ./Tools/check_model_pending_changes.py # Exits with 1 if there are pending migrations | |
- name: Run Migrations | |
run: dotnet ef database update --project ./ReplayBrowser/ReplayBrowser.csproj --no-build --verbose | |
- name: Run Tests | |
run: python ./Tools/test_pages_for_errors.py |