-
Notifications
You must be signed in to change notification settings - Fork 37
96 lines (93 loc) · 3.04 KB
/
ci.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: CI
on: [push, pull_request]
jobs:
test:
name: Test on JDK ${{matrix.java-version}} (${{matrix.os}})
strategy:
fail-fast: false
matrix:
java-version: [11, 17]
os: ['ubuntu-latest', 'windows-latest']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
cache: 'sbt'
- name: Run tests
run: sbt 'compile; ++2.13 test'
sbt-scripted:
name: sbt plugin scripted tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
# Sbt version that is tested (1.1.1) doesn't work on Java 17
java-version: 11
cache: 'sbt'
- name: Run tests
# Only publish stryker4s-core -api and -testrunner, sbt-stryker4s is published by scripted tests
run: sbt 'stryker4s-core2_12/publishLocal; stryker4s-api2_12/publishLocal; sbt-stryker4s-testrunner2_12/publishLocal; scripted sbt-stryker4s/test-1'
maven-plugin:
name: Test Maven plugin
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: coursier/cache-action@v6
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: Cleanup M2
run: rm -rf ~/.m2/repository/io/stryker-mutator/*/SET-BY-SBT-SNAPSHOT/
- name: Publish stryker4s-core
run: sbt 'publishM2Local'
- name: Run Maven tests
run: |
cd maven
mvn verify -B --no-transfer-progress
formatting:
name: Test formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: coursier/cache-action@v6
with:
extraFiles: 'bin/scalafmt,.scalafmt.conf'
extraKey: 'scalafmt'
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Test formatting
run: ./bin/scalafmt --test
release:
needs: [test, sbt-scripted, maven-plugin, formatting]
if: "github.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/tags/')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Fetch all commits, used by sbt-dynver plugin to determine version
fetch-depth: 0
# Fetch all tags
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
cache: 'sbt'
- name: Publish
run: sbt ci-release
env:
CI_RELEASE: stryker4sPublishSigned
CI_SONATYPE_RELEASE: stryker4sReleaseAll
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}