Continuous Integration

After each commit we would like to have a feedback about build result, linter and unit/e2e tests etc. For that reason we have to create yml files in folder: .github/workflows (for example: .github/workflows/build.yml ) with steps definition.

Angular 8

For angular application our file should look like on below snippet.

name: Build on:

push:

branches-ignore: master env:

NODE_VERSION: '10.x' jobs:

build:

name: Build Angular runs-on: ubuntu-latest steps:

- uses: actions/checkout@master

- name: Use Node.js ${{ env.NODE_VERSION }}

uses: actions/setup-node@v1

with:

node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies

run: npm install

- name: Lint

run: npm run lint

- name: Build

run: npm run build -- --prod

- name: Unit tests

run: npm run test

- name: E2E tests

run: npm run e2e

We have to define NodeJS version. We will run our build on ubuntu server. And we have a few steps that we should recognise if we are familiar with Angular apps development.

Also we run that configuration only for branches other then master . For master branch we have separate configuration (with deployment to Azure).

.NET Core 3

GitHub Actions definition file for .NET Core is also very simple.

name: Build on:

push:

branches-ignore: master jobs:

build:

name: Build .NET Core runs-on: ubuntu-latest steps:

- uses: actions/checkout@v1

- name: Setup .NET Core

uses: actions/setup-dotnet@v1

with:

dotnet-version: 3.0.100

- name: Build

working-directory: ./src/Application.Api

run: dotnet build --configuration Debug

- name: Unit tests

working-directory: ./tests/Application.Api.Tests

run: dotnet test