Skip to content

Commit 1b340c7

Browse files
committed
Test services build
1 parent 14cfd1a commit 1b340c7

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

.github/workflows/build-test.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Build Test
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
push:
7+
branches: [ main ]
8+
9+
jobs:
10+
docker-builds:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
service:
16+
- name: payforadoption-go
17+
path: PetAdoptions/payforadoption-go
18+
- name: petadoptionshistory-py
19+
path: PetAdoptions/petadoptionshistory-py
20+
- name: petlistadoptions-go
21+
path: PetAdoptions/petlistadoptions-go
22+
- name: petsearch-java
23+
path: PetAdoptions/petsearch-java
24+
- name: petsite
25+
path: PetAdoptions/petsite/petsite
26+
- name: trafficgenerator
27+
path: PetAdoptions/trafficgenerator/trafficgenerator
28+
29+
steps:
30+
- uses: actions/checkout@v3
31+
32+
- name: Set up Docker Buildx
33+
uses: docker/setup-buildx-action@v2
34+
35+
- name: Build ${{ matrix.service.name }}
36+
uses: docker/build-push-action@v4
37+
with:
38+
context: ${{ matrix.service.path }}
39+
push: false
40+
load: true
41+
tags: ${{ matrix.service.name }}:test
42+
cache-from: type=gha
43+
cache-to: type=gha,mode=max
44+
45+
nodejs-build:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v3
49+
50+
- name: Setup Node.js
51+
uses: actions/setup-node@v3
52+
with:
53+
node-version: '16'
54+
cache: 'npm'
55+
cache-dependency-path: PetAdoptions/petstatusupdater/package-lock.json
56+
57+
- name: Install dependencies
58+
run: npm ci
59+
working-directory: PetAdoptions/petstatusupdater
60+
61+
- name: Verify build
62+
run: npm run build --if-present
63+
working-directory: PetAdoptions/petstatusupdater
64+
65+
dotnet-builds:
66+
runs-on: ubuntu-latest
67+
strategy:
68+
fail-fast: false
69+
matrix:
70+
project:
71+
- name: petsite
72+
path: PetAdoptions/petsite/petsite.sln
73+
- name: trafficgenerator
74+
path: PetAdoptions/trafficgenerator/trafficgenerator.sln
75+
76+
steps:
77+
- uses: actions/checkout@v3
78+
79+
- name: Setup .NET
80+
uses: actions/setup-dotnet@v3
81+
with:
82+
dotnet-version: '6.0.x'
83+
84+
- name: Restore dependencies
85+
run: dotnet restore ${{ matrix.project.path }}
86+
87+
- name: Build
88+
run: dotnet build ${{ matrix.project.path }} --no-restore

0 commit comments

Comments
 (0)