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

Update sbt-precog to 2.5.7 #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
239 changes: 144 additions & 95 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,111 +1,160 @@
name: CI
on: [push, pull_request]
# This file was automatically generated by sbt-github-actions using the
# githubWorkflowGenerate task. You should add and commit this file to
# your git repository. It goes without saying that you shouldn't edit
# this file by hand! Instead, if you wish to make changes, you should
# change your sbt build configuration to revise the workflow description
# to meet your needs, then regenerate this file.

name: Continuous Integration

on:
pull_request:
branches: [master, backport/v*]
types: [opened, reopened, synchronize, ready_for_review]
push:
branches: [master, backport/v*]

env:
CI: true
CI_SNAPSHOT_RELEASE: +publishSigned
HUGO_VERSION: 0.26
SCALA_VERSION: 2.12.10
SBT: ./sbt
JABBA_INDEX: 'https://github.com/1Jo1/jabba/raw/support-graalvm-java-8-and-11/index.json'
REPO_SLUG: ${{ github.repository }}
ENCRYPTION_PASSWORD: ${{ secrets.ENCRYPTION_PASSWORD }}
GITHUB_ACTOR: precog-bot
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
validate:
name: Scala ${{ matrix.scala }}, Java ${{ matrix.java }}
runs-on: ubuntu-latest
build:
name: Build and Test
if: '!(github.event_name == ''pull_request'' && github.event.pull_request.draft)'
strategy:
fail-fast: false
matrix:
java: [[email protected], [email protected]]
scala: [2.12.10, 2.13.1]
env:
SCALA_VERSION: ${{ matrix.scala }}
os: [ubuntu-latest]
scala: [2.13.1]
java: [[email protected], [email protected]]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v5
- name: Checkout current branch (full)
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Java and Scala
uses: olafurpg/setup-scala@v10
with:
java-version: ${{ matrix.java }}
- name: Cache Coursier
uses: actions/cache@v1

- name: Cache sbt
uses: actions/cache@v2
with:
path: ~/.cache/coursier
key: sbt-coursier-cache
- name: Cache SBT
uses: actions/cache@v1
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}-${{ hashFiles('.versions.json') }}

- name: Common sbt setup
if: env.ENCRYPTION_PASSWORD != null
run: $SBT ++${{ matrix.scala }} transferCommonResources exportSecretsForActions

- name: Check that workflows are up to date
run: $SBT ++${{ matrix.scala }} githubWorkflowCheck

- run: $SBT ++${{ matrix.scala }} ci

- name: Compress target directories
run: tar cf targets.tar json4s-jackson/target website/target examples/ember/target blaze-client/target server/target examples/target blaze-server/target scalatags/target target argonaut/target examples/docker/target twirl/target docs/target laws/target tests/target prometheus-metrics/target servlet/target examples/tomcat/target examples/jetty/target testing/target ember-server/target json4s-native/target json4s/target okhttp-client/target examples/blaze/target client/target blaze-core/target circe/target examples/war/target jetty-client/target ember-client/target tomcat/target boopickle/target jetty/target play-json/target async-http-client/target core/target scala-xml/target dsl/target dropwizard-metrics/target ember-core/target jawn/target bench/target project/target

- name: Upload target directories
uses: actions/upload-artifact@v2
with:
path: ~/.sbt
key: sbt-${{ hashFiles('**/build.sbt') }}
- name: Check formatting
if: startsWith(matrix.scala, '2.12.') && (matrix.java == '[email protected]')
run: sbt ++$SCALA_VERSION scalafmtCheckAll
- name: Compile
run: sbt ++$SCALA_VERSION test:compile
# - name: Check compatibility
# run: sbt ++$SCALA_VERSION mimaReportBinaryIssues
- name: Check unused dependencies
run: sbt ++$SCALA_VERSION unusedCompileDependenciesTest
- name: Test
run: sbt ++$SCALA_VERSION test
- name: Scaladoc
run: sbt ++$SCALA_VERSION doc
scalafix:
name: Scalafix
runs-on: ubuntu-latest
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
path: targets.tar

publish:
name: Publish Artifacts
needs: [build]
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/backport/v'))
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.1]
java: [[email protected]]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v5
- name: Cache Coursier
uses: actions/cache@v1
- name: Checkout current branch (full)
uses: actions/checkout@v2
with:
path: ~/.cache/coursier
key: sbt-coursier-cache
- name: Cache SBT
uses: actions/cache@v1
fetch-depth: 0

- name: Setup Java and Scala
uses: olafurpg/setup-scala@v10
with:
path: ~/.sbt
key: sbt-${{ hashFiles('**/build.sbt') }}
- name: Scalafix
working-directory: ./scalafix
run: sbt ++$SCALA_VERSION test
project-site:
name: Project Site
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v5
- name: Cache Coursier
uses: actions/cache@v1
java-version: ${{ matrix.java }}

- name: Cache sbt
uses: actions/cache@v2
with:
path: ~/.cache/coursier
key: sbt-coursier-cache
- name: Cache SBT
uses: actions/cache@v1
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}-${{ hashFiles('.versions.json') }}

- name: Download target directories (2.13.1)
uses: actions/download-artifact@v2
with:
path: ~/.sbt
key: sbt-${{ hashFiles('**/build.sbt') }}
- name: Add ~/bin to PATH
run: echo "::add-path::$HOME/bin"
- name: Install Hugo
run: scripts/install-hugo
- name: Build project site
run: sbt ++$SCALA_VERSION website/makeSite
# docs:
# name: Doc Site
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: olafurpg/setup-scala@v5
# - name: Cache Coursier
# uses: actions/cache@v1
# with:
# path: ~/.cache/coursier
# key: sbt-coursier-cache
# - name: Cache SBT
# uses: actions/cache@v1
# with:
# path: ~/.sbt
# key: sbt-${{ hashFiles('**/build.sbt') }}
# - name: Add ~/bin to PATH
# run: echo "::add-path::$HOME/bin"
# - name: Install Hugo
# run: scripts/install-hugo
# - name: Build project site
# run: sbt ++$SCALA_VERSION docs/makeSite
name: target-${{ matrix.os }}-2.13.1-${{ matrix.java }}

- name: Inflate target directories (2.13.1)
run: |
tar xf targets.tar
rm targets.tar

- name: Common sbt setup
run: $SBT ++${{ matrix.scala }} transferCommonResources transferPublishAndTagResources exportSecretsForActions

- run: ./scripts/commonSetup

- name: Publish artifacts and create tag
run: ./scripts/publishAndTag ${{ github.repository }}

auto-merge:
name: Auto Merge
needs: [build]
if: 'github.event_name == ''pull_request'' && contains(github.head_ref, ''version-bump'') && contains(github.event.pull_request.labels.*.name, ''version: revision'')'
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.1]
java: [[email protected]]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (fast)
uses: actions/checkout@v2

- name: Setup Java and Scala
uses: olafurpg/setup-scala@v10
with:
java-version: ${{ matrix.java }}

- name: Common sbt setup
run: $SBT ++${{ matrix.scala }} transferCommonResources exportSecretsForActions

- name: Fetch the latest sdmerge
run: |
curl -L https://github.com/precog/devtools/raw/master/bin/sdmerge > /tmp/sdmerge
chmod +x /tmp/sdmerge

- name: Self-merge
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "Precog Bot"
/tmp/sdmerge $GITHUB_REPOSITORY $PR_NUMBER
59 changes: 59 additions & 0 deletions .github/workflows/clean.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This file was automatically generated by sbt-github-actions using the
# githubWorkflowGenerate task. You should add and commit this file to
# your git repository. It goes without saying that you shouldn't edit
# this file by hand! Instead, if you wish to make changes, you should
# change your sbt build configuration to revise the workflow description
# to meet your needs, then regenerate this file.

name: Clean

on: push

jobs:
delete-artifacts:
name: Delete Artifacts
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Delete artifacts
run: |
# Customize those three lines with your repository and credentials:
REPO=${GITHUB_API_URL}/repos/${{ github.repository }}

# A shortcut to call GitHub API.
ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; }

# A temporary file which receives HTTP response headers.
TMPFILE=/tmp/tmp.$$

# An associative array, key: artifact name, value: number of artifacts of that name.
declare -A ARTCOUNT

# Process all artifacts on this repository, loop on returned "pages".
URL=$REPO/actions/artifacts
while [[ -n "$URL" ]]; do

# Get current page, get response headers in a temporary file.
JSON=$(ghapi --dump-header $TMPFILE "$URL")

# Get URL of next page. Will be empty if we are at the last page.
URL=$(grep '^Link:' "$TMPFILE" | tr ',' '\n' | grep 'rel="next"' | head -1 | sed -e 's/.*<//' -e 's/>.*//')
rm -f $TMPFILE

# Number of artifacts on this page:
COUNT=$(( $(jq <<<$JSON -r '.artifacts | length') ))

# Loop on all artifacts on this page.
for ((i=0; $i < $COUNT; i++)); do

# Get name of artifact and count instances of this name.
name=$(jq <<<$JSON -r ".artifacts[$i].name?")
ARTCOUNT[$name]=$(( $(( ${ARTCOUNT[$name]} )) + 1))

id=$(jq <<<$JSON -r ".artifacts[$i].id?")
size=$(( $(jq <<<$JSON -r ".artifacts[$i].size_in_bytes?") ))
printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size
ghapi -X DELETE $REPO/actions/artifacts/$id
done
done
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.
addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.6.13")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.3.7")

addSbtPlugin("com.precog" % "sbt-precog" % "1.0.0")
addSbtPlugin("com.precog" % "sbt-precog" % "2.5.7")