Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(prism-agent): add unit tests workflow for prism agent #124

Merged
merged 1 commit into from
Nov 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/prism-agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Prism agent testing workflow

# Cancel previously running workflows if new commit pushed to the branch
# this will help to push fixes earlier and stop previous workflows
concurrency:
group: ${{ github.head_ref }}${{ github.ref }}-prism-agent
cancel-in-progress: true

# Default shell is `sh`
# which is old, use bourne-again version instead
defaults:
run:
shell: bash
working-directory: prism-agent/service

on:
# Run with every push to `main` branch
# Run with each PR opened vs PRISM agent
push:
branches:
- main
paths:
- ".github/workflows/prism-agent.yml"
- "prism-agent/**"
pull_request:
paths:
- ".github/workflows/prism-agent.yml"
- "prism-agent/**"

# Global environment variables for all jobs
env:
GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
ATALA_GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}

jobs:
build-and-test-prism-agent:
name: "Build and test prism agent"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Java and Scala
uses: olafurpg/setup-scala@v13
with:
java-version: openjdk@1.11

- name: Cache sbt
uses: coursier/cache-action@v6.3

- name: Run Scala formatter
run: sbt scalafmtCheckAll

- name: Build and test Castor
run: sbt test

- name: Aggregate test reports
if: always()
uses: ./.github/actions/aggregate-test-reports
with:
tests-dir: "prism-agent/service"

- name: Publish test results
# Publish even if the previous test step fails
if: always()
uses: EnricoMi/publish-unit-test-result-action@v2
with:
junit_files: "prism-agent/service/target/test-reports/**/TEST-*.xml"
comment_title: "PRISM Agent Test Results"
check_name: "PRISM Agent Test Results"