-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Intro security checks + PR pipeline (#4)
Previously, the solution structure was fixed and the code was revamped. This pull request includes updates to the build files, specifically the base image build file and the general build file. Additionally, a new build file was added. The changes ensure that the build process is accurate and up-to-date. Add PR pipeline and main branch release pipelines ---------
- Loading branch information
Showing
4 changed files
with
230 additions
and
44 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
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,87 @@ | ||
name: PR Validation | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
setup-dotnet: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
dotnet-installed: ${{ steps.setup_dotnet.outputs.success }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup .NET | ||
id: setup_dotnet | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: '8.0.x' | ||
|
||
codeql-scan: | ||
runs-on: ubuntu-latest | ||
needs: setup-dotnet | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: 'csharp' | ||
|
||
- name: Build the code | ||
run: dotnet build src/IpSimple.Platform.sln --configuration Release | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
needs: codeql-scan | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build solution | ||
run: dotnet build src/IpSimple.Platform.sln --configuration Release --output src/IpSimple.Platform/bin/Release | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Find and run all test projects | ||
run: | | ||
for test_project in $(find . -name "*.Tests.csproj"); do | ||
dotnet test "$test_project" --configuration Release --logger "trx;LogFileName=test_results.trx" --results-directory "TestResults" | ||
done | ||
- name: Publish Test Results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ipsimple-unit-test-results | ||
path: TestResults/ | ||
if: ${{ always() }} | ||
|
||
build-docker: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to GitHub Docker registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build Docker image (validation only) | ||
run: | | ||
docker build -f src/IpSimple.PublicIp.Api/Dockerfile -t ghcr.io/ipsimple/ipsimple-app-pr-validation src/ |
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,17 @@ | ||
# Pull Request Title | ||
|
||
**Description:** | ||
<!-- Please include a summary of the change and what issue is fixed. Also include relevant motivation and context. --> | ||
|
||
**Comments/Questions:** | ||
<!-- If you have any additional comments or questions, please add them here. --> | ||
|
||
**Checklist:** | ||
- [ ] Code is up-to-date with the `main` branch | ||
- [ ] No merge conflicts | ||
- [ ] Code has been properly tested | ||
- [ ] Documentation has been updated (if applicable) | ||
- [ ] Reviewers have been added (if applicable) | ||
|
||
**Related Issues:** | ||
<!-- If this PR addresses any issues, please mention them here (e.g., Fixes #123) --> |
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