Integration - Scala #224
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Integration - Scala | |
on: | |
schedule: | |
# Run the ci on the latest commit of master every day at 4:00 am | |
- cron: '00 04 * * *' | |
jobs: | |
tests: | |
name: Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "zulu" | |
java-version: "11" | |
- name: Setup repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Compile server | |
working-directory: ./be2-scala | |
run: sbt compile | |
- name: Assemble server jar file | |
working-directory: ./be2-scala | |
run: sbt assembly | |
- name: Run Karate server-client tests | |
id: tests_client | |
continue-on-error: true | |
working-directory: ./tests/karate | |
run: mvn test -DargLine=-Dkarate.env=scala_client -Dtest=BackEndTest#fullTest | |
- name: Publish Client Cucumber Report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Client Cucumber Report | |
path: ./tests/karate/target/scala_client/cucumber-html-reports | |
- name: Publish Client HTML Report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Client HTML Report | |
path: ./tests/karate/target/karate-reports | |
- name: Run Karate server-server tests | |
id: tests_server | |
continue-on-error: true | |
working-directory: ./tests/karate | |
run: mvn test -DargLine=-Dkarate.env=scala_server -Dtest=BackEndTest#fullTest | |
- name: Publish Server Cucumber Report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Server Cucumber Report | |
path: ./tests/karate/target/scala_server/cucumber-html-reports | |
- name: Publish Server HTML Report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Server HTML Report | |
path: ./tests/karate/target/karate-reports | |
- name: Publish Server logs | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Scala Server Logs | |
path: ./tests/karate/scala.log | |
# The next actions are pushing the new report to the defined branch | |
- name: Checkout report branch | |
uses: actions/checkout@v3 | |
with: | |
ref: report-karate-be2-scala | |
path: report-repo | |
- name: Update report | |
run: | | |
rm -rf report-repo/* | |
mkdir -p report-repo/scala_client | |
mkdir -p report-repo/scala_server | |
cp -a ./tests/karate/target/scala_client/cucumber-html-reports/. ./report-repo/scala_client/ | |
cp -a ./tests/karate/target/scala_server/cucumber-html-reports/. ./report-repo/scala_server/ | |
- name: Commit files | |
working-directory: ./report-repo | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add -A | |
git commit -m "Report from ${{ steps.date.outputs.date }}" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: report-karate-be2-scala | |
directory: report-repo | |
- name: Fail job if the tests were not successful | |
# Catchup of tests failure such that the job fo fail | |
if: steps.tests.outcome == 'failure' | |
run: exit 1 |