Skip to content

Commit d62ec6f

Browse files
brunoborgesdantelmomsft
authored andcommitted
Fix Tests run on daily schedule #31
1 parent ae612e9 commit d62ec6f

File tree

3 files changed

+100
-36
lines changed

3 files changed

+100
-36
lines changed

.github/workflows/infra-validation.yaml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/stale-bot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 'Close stale issues and PRs'
2+
on:
3+
schedule:
4+
- cron: '30 1 * * *'
5+
6+
jobs:
7+
stale:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/stale@v8
11+
with:
12+
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed.'
13+
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed.'
14+
close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.'
15+
close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.'
16+
days-before-issue-stale: 60
17+
days-before-pr-stale: 60
18+
days-before-issue-close: -1
19+
days-before-pr-close: -1
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Validate AZD template
2+
on:
3+
push:
4+
branches: [ main ]
5+
pull_request:
6+
branches: [ main ]
7+
schedule:
8+
- cron: '0 0 * * *' # Run at midnight every day
9+
10+
jobs:
11+
infra:
12+
name: "Infra Biceps Validation"
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
18+
- name: Build Bicep for linting
19+
uses: azure/CLI@v1
20+
with:
21+
inlineScript: az config set bicep.use_binary_from_path=false && az bicep build -f infra/main.bicep --stdout
22+
23+
- name: Run Microsoft Security DevOps Analysis
24+
uses: microsoft/security-devops-action@preview
25+
id: msdo
26+
continue-on-error: true
27+
with:
28+
tools: templateanalyzer
29+
30+
- name: Upload alerts to Security tab
31+
uses: github/codeql-action/upload-sarif@v2
32+
if: github.repository == 'Azure-Samples/azure-search-openai-demo'
33+
with:
34+
sarif_file: ${{ steps.msdo.outputs.sarifFile }}
35+
36+
frontend:
37+
name: "Front-end validation"
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v3
42+
43+
- name: Build React Frontend
44+
run: |
45+
echo "Building front-end and merge into Spring Boot static folder. Environment [${{ steps.set-deploy-env.outputs.DEPLOY_ENVIRONMENT }}]"
46+
cd ./app/frontend
47+
npm install
48+
npm run build
49+
50+
backend:
51+
name: "Backend validation"
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v3
56+
57+
- name: Set up Java version
58+
uses: actions/setup-java@v2
59+
with:
60+
distribution: 'microsoft'
61+
java-version: '17'
62+
cache: 'maven'
63+
64+
- name: Set environment for branch
65+
id: set-deploy-env
66+
run: |
67+
if [[ $GITHUB_REF_NAME == 'refs/heads/main' ]]; then
68+
echo "DEPLOY_ENVIRONMENT=Development" >> "$GITHUB_OUTPUT"
69+
elif [[ $GITHUB_REF_NAME == 'refs/heads/develop' ]]; then
70+
echo "DEPLOY_ENVIRONMENT=Development" >> "$GITHUB_OUTPUT"
71+
elif [[ $GITHUB_REF_NAME == 'refs/heads/release' ]]; then
72+
echo "DEPLOY_ENVIRONMENT=Development" >> "$GITHUB_OUTPUT"
73+
else
74+
echo "DEPLOY_ENVIRONMENT=Development" >> "$GITHUB_OUTPUT"
75+
fi
76+
77+
- name: Build Spring Boot App
78+
run: |
79+
echo "Building Spring Boot app. Environment [${{ steps.set-deploy-env.outputs.DEPLOY_ENVIRONMENT }}]"
80+
cd ./app/backend
81+
./mvnw verify

0 commit comments

Comments
 (0)