-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (80 loc) · 2.54 KB
/
pipeline.yml
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Build, Dockerize, Analyze with CodeQL, Synth
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: '26 5 * * 5'
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
analyze-with-code-ql:
# Uncomment if we need to analyze other code written in other programming languages
# name: analyze-with-code-ql-${{ matrix.language }}
runs-on: 'ubuntu-latest'
timeout-minutes: 360
permissions:
security-events: write
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: csharp
build-mode: autobuild
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
docker-images:
runs-on: ubuntu-latest
needs: [build-and-test, analyze-with-code-ql]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build Docker images
run: |
docker build -t jpmc-order-management-data-loader:$(date +%s) -f Dockerfile --platform "linux/amd64" --target service --build-arg "mainProject=JPMC.OrderManagement.DataLoader.Service" .
docker build -t jpmc-order-management-api:$(date +%s) -f Dockerfile --platform "linux/amd64" --target restapi --build-arg "mainProject=JPMC.OrderManagement.API" .
cdk-synth:
runs-on: ubuntu-latest
needs: [docker-images]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install AWS CDK
run: npm install -g aws-cdk
- name: CDK Synth All
shell: bash
run: |
for stack in $(cdk list); do
echo "Synthesizing stack: $stack"
cdk synth $stack
echo "Completed synthesizing $stack"
done
echo "All stacks have been synthesized."