diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..caaba1a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - name: Git checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '12' + + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'adopt' + + - name: Cache sbt + uses: actions/cache@v2 + with: + path: | + ~/.sbt + ~/.ivy2/cache + ~/.coursier/cache/v1 + ~/.cache/coursier/v1 + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/**/*.scala') }} + + - name: Cache Node + uses: actions/cache@v2 + with: + path: | + ~/.npm + ~/.nvm + ./codegen/target/scala-2.13/scalajs-bundler/test/node_modules + key: ${{ runner.os }}-node-cache-v3-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-cache-v3- + + - name: Run tests + run: sbt coverage test && sbt coverageAggregate coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} diff --git a/README.md b/README.md index be331a3..1ce56d8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ +[![CI](https://github.com/scommons/scommons-material-ui/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/scommons/scommons-material-ui/actions/workflows/ci.yml?query=workflow%3Aci+branch%3Amaster) +[![Coverage Status](https://coveralls.io/repos/github/scommons/scommons-material-ui/badge.svg?branch=master)](https://coveralls.io/github/scommons/scommons-material-ui/?branch=master) [![Scala.js](https://www.scala-js.org/assets/badges/scalajs-1.1.0.svg)](https://www.scala-js.org) ## Scala Commons Material UI