2020-04-23 00:49:44 -04:00
|
|
|
name: build
|
2020-04-23 00:47:21 -04:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-12-23 00:34:10 -05:00
|
|
|
branches: [ main ]
|
2020-04-23 00:47:21 -04:00
|
|
|
pull_request:
|
2020-12-23 00:34:10 -05:00
|
|
|
branches: [ main, develop ]
|
2020-04-23 00:47:21 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2021-02-02 00:39:20 -05:00
|
|
|
# extract branch name
|
|
|
|
- name: Extract branch name
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
shell: bash
|
|
|
|
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
|
|
|
|
id: extract_branch
|
|
|
|
|
|
|
|
# extract branch name on pull request
|
|
|
|
- name: Extract branch name on pull request
|
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF})" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
# print branch name
|
|
|
|
- name: Get branch name
|
|
|
|
run: echo "The branch name is ${{ env.BRANCH_NAME }}"
|
|
|
|
|
|
|
|
|
2022-04-13 11:56:22 -04:00
|
|
|
- uses: actions/checkout@v3
|
2020-04-23 00:47:21 -04:00
|
|
|
- name: Setup .NET Core
|
2022-04-12 09:54:16 -04:00
|
|
|
uses: actions/setup-dotnet@v2
|
2020-04-23 00:47:21 -04:00
|
|
|
with:
|
2022-04-12 09:54:16 -04:00
|
|
|
dotnet-version: 6.0.x
|
2021-02-02 00:39:20 -05:00
|
|
|
|
2020-05-11 06:26:53 -04:00
|
|
|
- name: Install minicover
|
2022-04-12 09:54:16 -04:00
|
|
|
run: dotnet tool install --global minicover --version 3.4.4
|
2021-02-02 00:39:20 -05:00
|
|
|
|
2020-04-23 00:47:21 -04:00
|
|
|
- name: Install dependencies
|
2020-11-01 22:55:43 -05:00
|
|
|
run: dotnet restore RulesEngine.sln
|
2021-02-02 00:39:20 -05:00
|
|
|
|
2020-04-23 00:47:21 -04:00
|
|
|
- name: Build
|
2020-11-01 22:55:43 -05:00
|
|
|
run: dotnet build RulesEngine.sln --configuration Release --no-restore
|
2021-02-02 00:39:20 -05:00
|
|
|
|
2020-05-11 06:26:53 -04:00
|
|
|
- name: Instrument
|
|
|
|
run: minicover instrument
|
2021-02-02 00:39:20 -05:00
|
|
|
|
2020-04-23 00:47:21 -04:00
|
|
|
- name: Test
|
2020-11-01 22:55:43 -05:00
|
|
|
run: dotnet test RulesEngine.sln --no-build --configuration Release --verbosity m
|
2021-02-02 00:39:20 -05:00
|
|
|
|
2020-05-11 06:26:53 -04:00
|
|
|
- name: Uninstrument
|
|
|
|
run: minicover uninstrument
|
2021-02-02 00:39:20 -05:00
|
|
|
|
2020-05-11 06:26:53 -04:00
|
|
|
- name: Report
|
2020-11-01 22:55:43 -05:00
|
|
|
run: minicover report --threshold 95
|
2020-05-11 07:11:36 -04:00
|
|
|
if: ${{ github.event_name == 'pull_request' }}
|
2021-02-02 00:39:20 -05:00
|
|
|
|
2020-05-11 07:11:36 -04:00
|
|
|
- name: Report coveralls
|
2021-02-02 00:39:20 -05:00
|
|
|
run: minicover coverallsreport --repo-token ${{ secrets.COVERALLS_TOKEN }} --branch ${{ env.BRANCH_NAME }}
|
2020-05-11 07:11:36 -04:00
|
|
|
if: ${{ github.event_name == 'push' }}
|