Skip to content

Commit

Permalink
Merge pull request #311 from GregFinzer/PullRequestValidation
Browse files Browse the repository at this point in the history
Add GitHub Action for Pull Requests
  • Loading branch information
GregFinzer authored Aug 14, 2024
2 parents 17f7b0f + fd009c2 commit b8d241b
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/pull_request_validation.yml
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

0 comments on commit b8d241b

Please sign in to comment.