Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cicd pipeline #2

Merged
merged 38 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
43f0c55
add basic api call. adding repository apis started
AlirezaEiji191379 Jul 2, 2024
9887f9a
add ValidationBehaviour.cs
AlirezaEiji191379 Jul 3, 2024
56f6426
correct .gitignore
AlirezaEiji191379 Jul 7, 2024
a7bf753
remoge idea project folder
AlirezaEiji191379 Jul 7, 2024
c075dee
update gitignore
AlirezaEiji191379 Jul 7, 2024
f788359
update and write good .gitignore
AlirezaEiji191379 Jul 7, 2024
d412049
some commits in github resolved
AlirezaEiji191379 Jul 7, 2024
6de173b
correct the name of unit tests for validation
AlirezaEiji191379 Jul 7, 2024
5d75c50
change dotnet sdk to 8.0 and correct json properties and change sets …
AlirezaEiji191379 Jul 7, 2024
4489435
remove validation behaviour, add validator and its tests in the creat…
AlirezaEiji191379 Jul 8, 2024
b5c0a8d
correct configuration options and dependency injection
AlirezaEiji191379 Jul 8, 2024
6ee026e
change all sets to inits
AlirezaEiji191379 Jul 8, 2024
920a0ba
correct namespaces; add dtos and use mapperly for map them to command…
AlirezaEiji191379 Jul 8, 2024
1a57e6c
correct the arcithecture of the code and use refit against pure http …
AlirezaEiji191379 Jul 10, 2024
ccdad3e
change gitignore
AlirezaEiji191379 Jul 10, 2024
727a5bd
remove .idea
AlirezaEiji191379 Jul 10, 2024
51046d7
create injection for refit interface types; create json serializer in…
AlirezaEiji191379 Jul 10, 2024
21489a3
correct directory.package.props and central package management
AlirezaEiji191379 Jul 11, 2024
e61eb1b
add github actions
AlirezaEiji191379 Jul 11, 2024
283cf8b
correct github actions
AlirezaEiji191379 Jul 11, 2024
1a60b4c
test the correct dotnet version
AlirezaEiji191379 Jul 13, 2024
ef56e37
test the correct dotnet version
AlirezaEiji191379 Jul 13, 2024
bcbfba2
correct dotnet test for not building
AlirezaEiji191379 Jul 13, 2024
6bbfb7f
add refit.newtonsoftjson; upgrade newtonsoftjson version; correct tes…
AlirezaEiji191379 Jul 13, 2024
5d413f5
Merge branch 'refs/heads/feature/add_repo_apis' into feature/DATALM-1…
AlirezaEiji191379 Jul 13, 2024
ac9d009
correct test build config
AlirezaEiji191379 Jul 13, 2024
3a499ef
add extra events
AlirezaEiji191379 Jul 13, 2024
b36d594
add ci for feature branches and pull requests on master
AlirezaEiji191379 Jul 13, 2024
cdb022b
add master_ci
AlirezaEiji191379 Jul 13, 2024
ddc89fe
ci: correct cicd
AlirezaEiji191379 Jul 14, 2024
bb4b1c6
fix: some bug
AlirezaEiji191379 Jul 14, 2024
3d2eac3
feat: add new fit
AlirezaEiji191379 Jul 14, 2024
80e7460
chore: correct pipeline cicd
AlirezaEiji191379 Jul 14, 2024
01efc1f
Merge branch 'refs/heads/master' into feature/DATALM-104294_add_ci_cd
AlirezaEiji191379 Jul 14, 2024
0b21953
fix: correct cicd pipeline to use one workflow
AlirezaEiji191379 Jul 14, 2024
dba2d40
fix: correct cicd
AlirezaEiji191379 Jul 14, 2024
0a083b1
fix: add test results
AlirezaEiji191379 Jul 14, 2024
5333d2e
chore: ci cd pipeline
AlirezaEiji191379 Jul 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/actions/build-and-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: build and test
AlirezaEiji191379 marked this conversation as resolved.
Show resolved Hide resolved
description: the action file for building and testing dotnet project

runs:
using: 'composite'
steps:
- name: set up dotnet core sdk
AlirezaEiji191379 marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

AlirezaEiji191379 marked this conversation as resolved.
Show resolved Hide resolved

- name: restoring dependencies
run: dotnet restore --no-cache
shell: bash

- name: build project
run: dotnet build --no-restore --configuration Release
shell: bash

- name: run unit tests
AlirezaEiji191379 marked this conversation as resolved.
Show resolved Hide resolved
run: dotnet test -c Release --no-restore --verbosity normal
shell: bash
32 changes: 32 additions & 0 deletions .github/actions/deploy/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: pack and publish nuget
description: action for pack and publish nuget to nuget repository

inputs:
nuget_api_key:
required: true
description: "nuget.org api key for publishing the nuget package"
runs:
using: 'composite'

steps:
- name: Generate Version
id: get_next_version
uses: thenativeweb/get-next-version@main

- name: create tag
if: ${{ steps.get_next_version.outputs.hasNextVersion == 'true' }}
run: |
git tag v${{ steps.get_next_version.outputs.version }}
git push origin v${{ steps.get_next_version.outputs.version }}
shell: bash

- name: pack the nuget package
if: ${{ steps.get_next_version.outputs.hasNextVersion == 'true' }}
run: dotnet pack --configuration Release --no-build --output ./nupkg /p:PackageVersion=${{ steps.get_next_version.outputs.version }}
shell: bash

- name: publish nuget package
if: ${{ steps.get_next_version.outputs.hasNextVersion == 'true' }}
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ inputs.nuget_api_key }} --source https://api.nuget.org/v3/index.json --skip-duplicate
shell: bash

21 changes: 21 additions & 0 deletions .github/workflows/feature_branch_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: build and test feature branches and pull requests on master

on:
push:
branches-ignore:
- master

pull_request:
branches:
- master

jobs:

build-and-test:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v4

- name: build and test
uses: ./.github/actions/build-and-test/
23 changes: 23 additions & 0 deletions .github/workflows/master_ci.yml
AlirezaEiji191379 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: build, test, pack and publish nuget package on nuget repository

on:
push:
branches:
- master

jobs:
build-test-deploy:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: build and test
uses: ./.github/actions/build-and-test/

- name: deploy
uses: ./.github/actions/deploy/
with:
nuget_api_key: ${{ secrets.NUGET_API_KEY }}
Loading