forked from playframework/play-scala-starter-example
-
Notifications
You must be signed in to change notification settings - Fork 27
/
semaphore.yml
66 lines (63 loc) · 3.16 KB
/
semaphore.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Use the latest stable version of Semaphore 2.0 YML syntax:
version: v1.0
# Name of your pipeline. In this example we connect two pipelines with
# a promotion, so it helps to differentiate what's the job of each.
name: Semaphore example for Scala Play
# An agent defines the environment in which your code runs.
# It is a combination of one of available machine types and operating
# system images. See:
# - https://docs.semaphoreci.com/article/20-machine-types
# - https://docs.semaphoreci.com/article/32-ubuntu-1804-image
agent:
machine:
type: e1-standard-2
os_image: ubuntu2004
# Blocks define the structure of a pipeline and are executed sequentially.
# Each block has a task that defines one or many parallel jobs. Jobs define
# the commands to execute.
# - https://docs.semaphoreci.com/article/62-concepts
blocks:
- name: "Scala with Play"
task:
env_vars:
# Define an environment variable
# Needed for use in scripts/test-sbt and scripts/test-gradle
# - https://docs.semaphoreci.com/article/66-environment-variables-and-secrets
- name: SCALA_VERSION
value: "2.12.6"
# Commands in prologue run at the beginning of each parallel job.
# - https://docs.semaphoreci.com/article/50-pipeline-yaml
prologue:
commands:
- cd $HOME
- ls -lah
# Checkout code from Git repository. This step is mandatory if the
# job is to work with your code.
- checkout
# sem-version expects binary version:
- sem-version scala 2.12
# Restore dependencies from cache, command won't fail if key is
# missing. More on caching:
# - https://docs.semaphoreci.com/article/54-toolbox-reference#cache
- cache restore sbt-java$JAVA_VERSION-$SEMAPHORE_GIT_BRANCH-$(checksum $SEMAPHORE_PROJECT_NAME/build.sbt),sbt-java$JAVA_VERSION-$SEMAPHORE_GIT_BRANCH,sbt-java$JAVA_VERSION-master
- cache restore ivy2-java$JAVA_VERSION-$SEMAPHORE_GIT_BRANCH-$(checksum $SEMAPHORE_PROJECT_NAME/build.sbt),ivy2-java$JAVA_VERSION-$SEMAPHORE_GIT_BRANCH,ivy2-java$JAVA_VERSION-master
- cache restore gradle-java$JAVA_VERSION-$SEMAPHORE_GIT_BRANCH-$(checksum $SEMAPHORE_PROJECT_NAME/build.sbt),gradle-java$JAVA_VERSION-$SEMAPHORE_GIT_BRANCH,gradle-java$JAVA_VERSION-master
jobs:
- name: Tests
# Define variables for a build matrix
# - https://docs.semaphoreci.com/article/50-pipeline-yaml#matrix
matrix:
- env_var: JAVA_VERSION
values: ["8", "11"]
commands:
- sem-version java $JAVA_VERSION
- ./scripts/test-sbt
- ./scripts/test-gradle
# Commands in epilogue run at the end of each parallel job.
epilogue:
commands:
- cd $HOME
- ls -lah
- cache store sbt-java$JAVA_VERSION-$SEMAPHORE_GIT_BRANCH-$(checksum $SEMAPHORE_PROJECT_NAME/build.sbt) .sbt
- cache store ivy2-java$JAVA_VERSION-$SEMAPHORE_GIT_BRANCH-$(checksum $SEMAPHORE_PROJECT_NAME/build.sbt) .ivy2/cache
- cache store gradle-java$JAVA_VERSION-$SEMAPHORE_GIT_BRANCH-$(checksum $SEMAPHORE_PROJECT_NAME/build.sbt) .gradle/caches