Skip to content

Commit cc556cb

Browse files
authored
Update tests.yml
1 parent 29882c7 commit cc556cb

File tree

1 file changed

+63
-9
lines changed

1 file changed

+63
-9
lines changed

.github/workflows/tests.yml

+63-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# This workflow will build and test a .NET 6 web API.
2-
# The tests will be a subset of tests which run quickly while still getting good code coverage.
1+
# This workflow will build and test a .NET 6 web API
2+
#
3+
# For more samples to get started with GitHub Action workflows to deploy to Azure, refer to https://github.com/Azure/actions-workflow-samples
34
name: Test|API|Profile Designer
45
on:
56
#manually trigger deploy
@@ -8,17 +9,70 @@ on:
89
push:
910
branches:
1011
- develop
12+
- CO5/Develop
13+
- PLY/Develop
1114
- main
1215
pull_request:
1316
branches:
1417
- develop
18+
- CO5/Develop
19+
- PLY/Develop
1520
- main
1621

17-
22+
env:
23+
# set this to the path to your solution file, defaults to the repository root (this is the folder in the git repo)
24+
SOLUTION_DIRECTORY: './'
25+
# set this to the path to your web app project, defaults to the repository root (this is the folder in the git repo)
26+
PROJECT_DIRECTORY: './api/CESMII.ProfileDesigner.Api'
27+
# Solution file to use
28+
SOLUTION_FILE: 'CESMII.ProfileDesigner.sln'
29+
# Project file to use
30+
PROJECT_NAME: 'CESMII.ProfileDesigner.Api'
31+
# set this to the .NET core version to use
32+
NETCORE_VERSION: "6.0.x"
33+
1834
jobs:
19-
#call a common workflow which checks out, builds, publishes, zips, deploys to AWS Elastic beanstalk
20-
call-workflow-publish-common-aws:
21-
uses: ./.github/workflows/tests-shared.yml
22-
with:
23-
TEST_FILTER: ''
24-
BUILD_TARGET: 'Staging'
35+
build:
36+
name: Build and Test .NET6 Web API
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
with:
41+
submodules: true
42+
- name: Set up dotnet Core ${{ env.NETCORE_VERSION }}
43+
uses: actions/setup-dotnet@v4
44+
with:
45+
dotnet-version: ${{ env.NETCORE_VERSION }}
46+
47+
- name: Start PostgreSQL on Ubuntu for use by integration tests
48+
run: |
49+
sudo systemctl start postgresql.service
50+
pg_isready
51+
- name: Create additional user
52+
run: |
53+
sudo -u postgres psql --command="CREATE USER profiledesigner SUPERUSER PASSWORD 'cesmii'" --command="\du"
54+
- name: List existing databases
55+
run: |
56+
sudo -u postgres psql -l
57+
- name: Create database
58+
run: |
59+
sudo -u postgres psql --command="CREATE DATABASE profile_designer_local_test WITH OWNER = profiledesigner TABLESPACE = pg_default CONNECTION LIMIT = -1;"
60+
- name: Create schema
61+
run: |
62+
ls -l ./sql
63+
head -5 ./sql/CESMII.ProfileDesigner.DB.sql
64+
sudo -u postgres psql -d profile_designer_local_test < ./sql/CESMII.ProfileDesigner.DB.sql
65+
#sudo -u postgres psql -d profile_designer_local_test --file ./sql/CESMII.ProfileDesigner.DB.sql
66+
- name: List existing databases
67+
run: |
68+
sudo -u postgres psql -l
69+
70+
- name: Restore dependencies (${{env.SOLUTION_FILE}})
71+
run: dotnet restore ${{env.SOLUTION_FILE}}
72+
working-directory: ${{env.SOLUTION_DIRECTORY}}
73+
- name: Build (${{env.SOLUTION_FILE}})
74+
run: dotnet build ${{env.SOLUTION_FILE}} --configuration Staging --no-restore
75+
working-directory: ${{env.SOLUTION_DIRECTORY}}
76+
- name: Test (${{env.SOLUTION_FILE}})
77+
run: dotnet test ${{env.SOLUTION_FILE}} --configuration Staging --no-build --verbosity normal -l:"console;verbosity=normal"
78+
working-directory: ${{env.SOLUTION_DIRECTORY}}

0 commit comments

Comments
 (0)