Scala/.travis.yml

181 lines
7.3 KiB
YAML

# `-Dsbt.io.jdktimestamps=true` is used to work around
# this bug in sbt 1.9.8: https://github.com/sbt/sbt/issues/7463
# we can remove it once we're on an sbt version with a fix.
version: ~> 1.0 # needed for imports
import: scala/scala-dev:travis/default.yml
dist: xenial # GPG stuff breaks on bionic; scala/scala-dev#764
language: scala
stages:
- build
- test
templates: # this has no effect on travis, it's just a place to put our templates
pr-jdk8: &pr-jdk8
if: type = pull_request OR repo != scala/scala
cron-jdk17: &cron-jdk17
if: type = cron AND repo = scala/scala
env: ADOPTOPENJDK=17
build-for-testing: &build-for-testing
# pull request validation (w/ bootstrap)
# differs from the build that publishes releases / integration builds:
# - not using bash script setup, but just the underlying sbt calls
# - publishing locally rather than to Artifactory
# the bootstrap above is older historically; this way of doing it is newer
# and also simpler. we should aim to reduce/eliminate the duplication.
stage: build
name: build, publishLocal, build again
script:
- set -e
- sbt -Dsbt.io.jdktimestamps=true -Dsbt.scala.version=2.12.18-M2 setupPublishCore generateBuildCharacterPropertiesFile headerCheck publishLocal
- STARR=$(sed -n 's/^maven\.version\.number=//p' buildcharacter.properties) && echo $STARR
- sbt -Dsbt.io.jdktimestamps=true -Dsbt.scala.version=2.12.18-M2 -Dstarr.version=$STARR setupValidateTest compile
workspaces:
create:
name: bootstrapped
paths:
# so new STARR will be available
- "buildcharacter.properties"
- "$HOME/.ivy2/local/org.scala-lang"
# so build products built using new STARR are kept
- "target"
- "project/target"
- "project/project/target"
- "project/project/project/target"
- "dist"
- "build"
test1: &test1
stage: test
name: tests (junit, scalacheck, et al)
workspaces:
use: bootstrapped
script:
- set -e
- STARR=$(sed -n 's/^maven\.version\.number=//p' buildcharacter.properties) && echo $STARR
- sbt -Dsbt.io.jdktimestamps=true -Dsbt.scala.version=2.12.18-M2 -Dstarr.version=$STARR setupValidateTest Test/compile testAll1
test2: &test2
stage: test
name: tests (partest)
workspaces:
use: bootstrapped
script:
- set -e
- STARR=$(sed -n 's/^maven\.version\.number=//p' buildcharacter.properties) && echo $STARR
- sbt -Dsbt.io.jdktimestamps=true -Dsbt.scala.version=2.12.18-M2 -Dstarr.version=$STARR setupValidateTest testAll2
jobs:
include:
- stage: build
if: (type = push OR type = api) AND repo = scala/scala # api for manually triggered release builds
name: publish (bootstrapped) to scala-integration or sonatype
script:
# see comment in `bootstrap_fun` for details on the procedure
# env available in each stage
# - by travis config (see below): secret env vars
# - by `common` script: WORKSPACE, IVY2_DIR, SBT_CMD, integrationRepoUrl
# - by `bootstrap_fun`: publishPrivateTask, ...
- set -e
- (cd admin && ./init.sh)
- source scripts/common
- source scripts/bootstrap_fun
- determineScalaVersion
- removeExistingBuilds $integrationRepoUrl
- if [ ! -z "$STARR_REF" ]; then buildStarr; fi
- buildLocker
- buildQuick
- triggerScalaDist
- <<: *build-for-testing
<<: *pr-jdk8
- <<: *test1
<<: *pr-jdk8
- <<: *test2
<<: *pr-jdk8
- <<: *build-for-testing
<<: *cron-jdk17
- <<: *test1
<<: *cron-jdk17
- <<: *test2
<<: *cron-jdk17
- stage: test
name: build library with Scala 3
if: type = pull_request OR repo != scala/scala
workspaces:
use: bootstrapped
script:
- set -e
- STARR=$(sed -n 's/^maven\.version\.number=//p' buildcharacter.properties) && echo $STARR
- sbt -Dsbt.io.jdktimestamps=true -Dsbt.scala.version=2.12.18-M2 -Dscala.build.compileWithDotty=true library/compile
- name: build benchmarks
if: type = pull_request OR repo != scala/scala
workspaces:
use: bootstrapped
script:
- set -e
- STARR=$(sed -n 's/^maven\.version\.number=//p' buildcharacter.properties) && echo $STARR
- sbt -Dsbt.io.jdktimestamps=true -Dsbt.scala.version=2.12.18-M2 bench/Jmh/compile
- stage: build
if: type = pull_request OR type = push
name: language spec
dist: focal
language: ruby
rvm: 2.7
install:
- ruby -v
- gem install bundler -v "< 2.5" #scala-dev#857
- bundler --version
- bundle install --path vendor/bundle
# cribbed from https://github.com/SebastiaanKlippert/go-wkhtmltopdf/blob/master/.travis.yml
- sudo apt-get update
- sudo apt-get install -y build-essential xorg xfonts-75dpi libpng16-16 libssl1.1
- wget --quiet "https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb"
- sudo dpkg -i "wkhtmltox_0.12.6-1.bionic_amd64.deb"
- rm "wkhtmltox_0.12.6-1.bionic_amd64.deb"
script:
- set -e
- (cd admin && ./init.sh)
- bundle exec jekyll build -s spec/ -d build/spec
- export JEKYLL_ENV=spec-pdf
- bundle exec jekyll build -s spec/ -d build/spec-pdf
- ./scripts/generate-spec-pdf.sh
after_success:
- ./scripts/travis-publish-spec.sh
env:
global:
- ADOPTOPENJDK=8
- secure: "P8EqpZoin/YTnwel9TTxSSAHtXfZ4M262BKXlYUZmjoQsjyvXDAeZ7yAqgAvX5BeRFrGkBToPiE+V60stdWkPKs3+9COw2BDUB1CULBHhRY9Lxordmz0xVhgEfsoH4f6r6wOlIQ9kuaWhmP+JdB/mzOHZhLch9ziPi8O46Z8t4k=" # PRIV_KEY_SECRET, for scripts/travis-publish-spec.sh
- secure: "T1fxtvLTxioyXJYiC/zVYdNYsBOt+0Piw+xE04rB1pzeKahm9+G2mISdcAyqv6/vze9eIJt6jNHHpKX32/Z3Cs1/Ruha4m3k+jblj3S0SbxV6ht2ieJXLT5WoUPFRrU68KXI8wqUadXpjxeJJV53qF2FC4lhfMUsw1IwwMhdaE8=" # PRIVATE_REPO_PASS, for publishing to scala-ci Artifactory
- secure: "dbAvl6KEuLwZ0MVQPZihFsPzCdiLbX0EFk3so+hcfEbksrmLQ1tn4X5ZM7Wy1UDR8uN9lxngEwHch7a7lKqpugzmXMew9Wnikr9WBWbJT77Z+XJ/jHI6YuiCRpRo+nvxXGp9Ry80tSIgx5eju0J83IaJL41BWlBkvyAd7YAHORI=" # GPG_SUBKEY_SECRET, so we can sign JARs
- secure: "RTyzS6nUgthupw5M0fPwTlcOym1sWgBo8eXYepB2xGiQnRu4g583BGuNBW1UZ3vIjRETi/UKQ1HtMR+i7D8ptF1cNpomopncVJA1iy7pU2w0MJ0xgIPMuvtkIa3kxocd/AnxAp+UhUad3nC8lDpkvZsUhhyA0fb4iPKipd2b2xY=" # TRAVIS_TOKEN (login with GitHub as SethTisue), for triggering scala-dist job
- secure: "PbDzgRGivsDM/1P18dIAZiZnK8yG+fxU/9Ho6DkAd8pvsu7S08MPks+ekM0uSVeKxYj7Npzd3XTe4weEXM7Jtljy3CRHoPasI0TF/6ZVOb7H+MMP1cg9K1xrZXKfEk2RABCbMxKtrEv9BDa/lVtjCCEKWAIPz38Z6q2mKk417Ps=" # SONA_USER, token username for publishing to Sonatype
- secure: "D/V5nrAJsAc6t5ZMoeSt37ViIsJyRmagA286M3zWn/uZhgk4mbgYfzu6rDbYeUTBB9jX8YHKPtzUrxqcnlpkV8z6USAbDhzYSLL/QqcLnTjKZZ3KvPEimNQIXX8Nb1KIrlXNQ/xTE8u+GNvQLDdxa60QqlzvA3tt5vnVl3GatFE=" # SONA_PASS, token password for publishing to Sonatype
# caching for sdkman / sbt / ivy / coursier imported from scala-dev
cache:
directories:
- $HOME/.rvm
notifications:
slack:
rooms:
- typesafe:WoewGgHil2FkdGzJyV3phAhj
if: (type = cron OR type = push) AND repo = scala/scala
on_success: never
on_failure: change
webhooks: https://scala-ci.typesafe.com/benchq/webhooks/travis