From 68647d9faf0207dba6f76b426bf6c4e4e83a66d3 Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Sun, 6 Feb 2022 11:32:10 -0500 Subject: [PATCH] add github actions --- .github/workflows/branch-ci.yml | 41 +++++++++++++++++++++++++++++++++ .github/workflows/master-ci.yml | 40 ++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 19 +++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 .github/workflows/branch-ci.yml create mode 100644 .github/workflows/master-ci.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/branch-ci.yml b/.github/workflows/branch-ci.yml new file mode 100644 index 0000000..9a71c9b --- /dev/null +++ b/.github/workflows/branch-ci.yml @@ -0,0 +1,41 @@ +name: Branch CI +on: + push: + branches-ignore: + - master + +jobs: + build: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'skip ci')" + steps: + - name: Cache SBT ivy cache + uses: actions/cache@v2 + with: + path: ~/.ivy2/cache + key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('build.sbt') }} + - name: Cache SBT + uses: actions/cache@v2 + with: + path: ~/.sbt + key: ${{ runner.os }}-sbt-${{ hashFiles('build.sbt') }} + - name: Cache Coursier + uses: actions/cache@v2 + with: + path: ~/.cache + key: ${{ runner.os }}-coursier-${{ hashFiles('build.sbt') }} + - name: Cache .jabba + uses: actions/cache@v2 + with: + path: ~/.jabba + key: ${{ runner.os }}-jabba-${{ hashFiles('build.sbt') }} + - uses: actions/checkout@v2 + - name: Compile and test + run: | + sbt \ + 'set core.jvm / Compile / scalacOptions += "-Werror"' \ + 'set core.js / Compile / scalacOptions += "-Werror"' \ + 'set macros.jvm / Compile / scalacOptions += "-Werror"' \ + 'set macros.js / Compile / scalacOptions += "-Werror"' \ + compile \ + test diff --git a/.github/workflows/master-ci.yml b/.github/workflows/master-ci.yml new file mode 100644 index 0000000..b89b54d --- /dev/null +++ b/.github/workflows/master-ci.yml @@ -0,0 +1,40 @@ +name: Master CI +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Cache SBT ivy cache + uses: actions/cache@v2 + with: + path: ~/.ivy2/cache + key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('build.sbt') }} + - name: Cache SBT + uses: actions/cache@v2 + with: + path: ~/.sbt + key: ${{ runner.os }}-sbt-${{ hashFiles('build.sbt') }} + - name: Cache Coursier + uses: actions/cache@v2 + with: + path: ~/.cache + key: ${{ runner.os }}-coursier-${{ hashFiles('build.sbt') }} + - name: Cache .jabba + uses: actions/cache@v2 + with: + path: ~/.jabba + key: ${{ runner.os }}-jabba-${{ hashFiles('build.sbt') }} + - uses: actions/checkout@v2 + - name: Compile and test + run: | + sbt \ + 'set core.jvm / Compile / scalacOptions += "-Werror"' \ + 'set core.js / Compile / scalacOptions += "-Werror"' \ + 'set macros.jvm / Compile / scalacOptions += "-Werror"' \ + 'set macros.js / Compile / scalacOptions += "-Werror"' \ + compile \ + test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ffaea8b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,19 @@ +name: Release +on: + push: + branches: [master, main] + tags: ["*"] +jobs: + publish: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + - uses: olafurpg/setup-scala@v10 + - run: sbt ci-release + env: + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + PGP_SECRET: ${{ secrets.PGP_SECRET }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}