Skip to content

Commit

Permalink
Fix Tests run on daily schedule #31
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoborges committed Oct 18, 2023
1 parent fc733e6 commit a04d508
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 36 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/infra-validation.yaml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/stale-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
with:
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.'
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.'
close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.'
close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.'
days-before-issue-stale: 60
days-before-pr-stale: 60
days-before-issue-close: -1
days-before-pr-close: -1
81 changes: 81 additions & 0 deletions .github/workflows/template-validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Validate AZD template
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 0 * * *' # Run at midnight every day

jobs:
infra:
name: "Infra Biceps Validation"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build Bicep for linting
uses: azure/CLI@v1
with:
inlineScript: az config set bicep.use_binary_from_path=false && az bicep build -f infra/main.bicep --stdout

- name: Run Microsoft Security DevOps Analysis
uses: microsoft/security-devops-action@preview
id: msdo
continue-on-error: true
with:
tools: templateanalyzer

- name: Upload alerts to Security tab
uses: github/codeql-action/upload-sarif@v2
if: github.repository == 'Azure-Samples/azure-search-openai-demo'
with:
sarif_file: ${{ steps.msdo.outputs.sarifFile }}

frontend:
name: "Front-end validation"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build React Frontend
run: |
echo "Building front-end and merge into Spring Boot static folder. Environment [${{ steps.set-deploy-env.outputs.DEPLOY_ENVIRONMENT }}]"
cd ./app/frontend
npm install
npm run build
backend:
name: "Backend validation"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Java version
uses: actions/setup-java@v2
with:
distribution: 'microsoft'
java-version: '17'
cache: 'maven'

- name: Set environment for branch
id: set-deploy-env
run: |
if [[ $GITHUB_REF_NAME == 'refs/heads/main' ]]; then
echo "DEPLOY_ENVIRONMENT=Development" >> "$GITHUB_OUTPUT"
elif [[ $GITHUB_REF_NAME == 'refs/heads/develop' ]]; then
echo "DEPLOY_ENVIRONMENT=Development" >> "$GITHUB_OUTPUT"
elif [[ $GITHUB_REF_NAME == 'refs/heads/release' ]]; then
echo "DEPLOY_ENVIRONMENT=Development" >> "$GITHUB_OUTPUT"
else
echo "DEPLOY_ENVIRONMENT=Development" >> "$GITHUB_OUTPUT"
fi
- name: Build Spring Boot App
run: |
echo "Building Spring Boot app. Environment [${{ steps.set-deploy-env.outputs.DEPLOY_ENVIRONMENT }}]"
cd ./app/backend
./mvnw verify

0 comments on commit a04d508

Please sign in to comment.