aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yaml
blob: be473c2041909d04c0bccacdf20018e38ce27237 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Routine Build And Test

on:
  push:
    branches: [dev]
    paths-ignore:
      - "**/README.md"
  pull_request:
    branches: [dev]
    paths-ignore:
      - "**/README.md"

jobs:
  front-end:
    name: Front End Build
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: Timeline/ClientApp
        shell: bash

    steps:
      - uses: actions/checkout@v2

      - name: Restore Cache
        uses: actions/cache@v2
        with:
          path: |
            Timeline/ClientApp/.pnp.*
            Timeline/ClientApp/.yarn
            !Timeline/ClientApp/.yarn/releases
            !Timeline/ClientApp/.yarn/plugins
          key: yarn-${{ runner.os }}-${{ hashFiles('Timeline/ClientApp/yarn.lock') }}
          restore-keys: |
            yarn-${{ runner.os }}-

      - name: Use Node.js 14
        uses: actions/setup-node@v1
        with:
          node-version: "14"

      - name: Restore Packages
        run: yarn

      - name: Build App
        run: yarn build

      - name: Upload Artifact
        uses: actions/upload-artifact@v2
        with:
          name: front-end
          path: Timeline/ClientApp/dist/

  back-end:
    name: Back End Build And Test
    runs-on: ubuntu-latest
    env:
      ASPNETCORE_ENVIRONMENT: "Development"

    steps:
      - uses: actions/checkout@v2

      - name: Use .Net Core 3.1.x
        uses: actions/setup-dotnet@v1
        with:
          dotnet-version: "3.1.x"

      - name: Build And Test
        run: dotnet test --logger html --collect:"XPlat Code Coverage" --settings './Timeline.Tests/coverletArgs.runsettings'

      - name: Upload Test Artifact
        uses: actions/upload-artifact@v2
        if: ${{ success() || failure() }}
        with:
          name: back-end-test
          path: Timeline.Tests/TestResults/