-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #311 from GregFinzer/PullRequestValidation
Add GitHub Action for Pull Requests
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Build and Test for Pull Requests | ||
|
||
on: | ||
pull_request: | ||
# This will trigger the workflow for pull requests targeting any branch | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set environment variable from secret | ||
run: echo "GOLD=${{ secrets.GOLD }}" >> $GITHUB_ENV | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '8.0.x' # Adjust the version if needed | ||
|
||
- name: Replace Connection String in appsettings.Development.json | ||
run: | | ||
sed -i 's#"DefaultConnection": ".*"#"DefaultConnection": "${{ secrets.DEV_CONNECTION_STRING }}"#' ./BedBrigade.Client/appsettings.Development.json | ||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Build project | ||
run: dotnet build --configuration Release --no-restore | ||
|
||
- name: Run tests | ||
run: dotnet test |