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(iris): add format and testing for iris client PRs #104

Merged
merged 3 commits into from
Nov 9, 2022
Merged
Show file tree
Hide file tree
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
68 changes: 68 additions & 0 deletions .github/workflows/iris-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Iris client 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 }}-iris-client
cancel-in-progress: true

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

env:
GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
ATALA_GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}

defaults:
run:
shell: bash
working-directory: "iris/client/scala-client"

jobs:
build-and-test-iris-client:
name: "Build and test Iris client"
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 Iris client
run: sbt test

- name: Aggregate test reports
if: always()
uses: ./.github/actions/aggregate-test-reports
with:
tests-dir: "iris/client/scala-client"

- name: Publish test results
# Publish even if the test step fails
if: always()
uses: EnricoMi/publish-unit-test-result-action@v2
with:
junit_files: "iris/client/scala-client/target/test-reports/**/TEST-*.xml"
comment_title: "Iris Client Test Results"
check_name: "Iris Client Test Results"
4 changes: 4 additions & 0 deletions iris/client/scala-client/.scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version = 3.5.8
runner.dialect = scala3

maxColumn = 120
2 changes: 1 addition & 1 deletion iris/client/scala-client/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inThisBuild(
versionScheme := Some("semver-spec"),
githubOwner := "input-output-hk",
githubRepository := "atala-prism-building-blocks",
githubTokenSource := TokenSource.Environment("GITHUB_TOKEN")
githubTokenSource := TokenSource.Environment("ATALA_GITHUB_TOKEN")
)
)

Expand Down
1 change: 1 addition & 0 deletions iris/client/scala-client/project/scalapb.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.6")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.3")
Expand Down