Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
52 changes: 52 additions & 0 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Continuous Integration
on: [push] # Will make the workflow run every time you push to any branch

jobs:
build:
name: Build and test
runs-on: ubuntu-latest # Sets the build environment a machine with the latest Ubuntu installed
steps:
- uses: actions/checkout@v4 # Adds a step to checkout the repository code

- name: Build c-sharp
run: dotnet build

- name: Install dependancies
working-directory: ./DotnetTemplate.Web
run: npm install

- name: Build TypeScript
working-directory: ./DotnetTemplate.Web
run: npm run build

- name: Run TS linter
working-directory: ./DotnetTemplate.Web
run: npm run lint

- name: Run TS tests
working-directory: ./DotnetTemplate.Web
run: npm t

- name: Run c-sharp tests
run: dotnet test

- name: Post to slack
id: slack
uses: slackapi/slack-github-action@v1.26.0
with:
payload: |
{
"text": "Your MR pipeline has finished! Result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
52 changes: 52 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Here we specify what causes the pipeline to run; in this case changes to any branch
trigger:
- '*'

# Here we specify what type of machine (agent) to run on
pool:
vmImage: 'ubuntu-latest'

# And here we specify a list of "jobs"
jobs:
- job: buildAndTestCsharp
displayName: "Build C Sharp and Run Tests"
# Each job has a sequence of steps to run
steps:
- task: DotNetCoreCLI@2
inputs:
command: 'build'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
- job: buildTypeScript
displayName: Build TypeScript
steps:
- task: Npm@1
inputs:
workingDir: ./DotnetTemplate.Web
command: 'install'
- task: Npm@1
inputs:
command: 'custom'
customCommand: 'run build'
workingDir: ./DotnetTemplate.Web
- task: Npm@1
inputs:
command: 'custom'
customCommand: 'run lint'
workingDir: ./DotnetTemplate.Web
- task: Npm@1
inputs:
command: 'custom'
customCommand: 't'
workingDir: ./DotnetTemplate.Web
- job: publishArtefact
displayName: Publish Artefact
steps:
- script: dotnet publish -c Release -o ./dist
displayName: Generate the executable
- task: PublishPipelineArtifact@1
displayName: Publish the artefact
inputs:
targetPath: '$(Pipeline.Workspace)'
publishLocation: 'pipeline'