-
Notifications
You must be signed in to change notification settings - Fork 1
130 lines (124 loc) · 3.79 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Univalence Continuous Integration
on:
pull_request:
push:
branches: ["master"]
tags: ["v*.*.*"]
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
uses: actions/checkout@v2.4.0
- name: Setup Scala and Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Cache scala dependencies
uses: coursier/cache-action@v6
- name: Check formatting and linting
run: sbt "-Dfatal-warnings=true" check
test:
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- name: Checkout current branch
uses: actions/checkout@v2.4.0
- name: Setup Scala and Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Cache scala dependencies
uses: coursier/cache-action@v6
- name: Run tests
run: sbt testWithCoverage
- name: Publish coverage to codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_SECRET }}
documentation:
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- name: Checkout current branch
uses: actions/checkout@v2.4.0
- uses: actions/setup-node@v3
# TEMPORARY FIX
# with:
# cache: npm
# cache-dependency-path: website/package-lock.json
- name: Install dependencies
working-directory: website
run: npm ci
- name: Build documentation
working-directory: website
run: npm run build
publish:
runs-on: ubuntu-20.04
timeout-minutes: 60
needs: [check, test]
if: github.event_name != 'pull_request'
steps:
- name: Checkout current branch
uses: actions/checkout@v2.4.0
with:
fetch-depth: 0
- name: Setup Scala and Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Publish the library
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 }}
CI_RELEASE: publishSigned
CI_SNAPSHOT_RELEASE: publish
release:
runs-on: ubuntu-20.04
timeout-minutes: 60
needs: [publish]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout current branch
uses: actions/checkout@v2.4.0
with:
fetch-depth: 0
- name: Set the release version
shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV
- name: Create changes
shell: bash
run: touch CHANGES.md
- name: Generate a changelog
uses: orhun/git-cliff-action@v1
id: git-cliff
with:
config: cliff.toml
args: -vv --latest --strip header
env:
OUTPUT: CHANGES.md
- name: Set the release body
id: release
shell: bash
run: |
r=$(cat ${{ steps.git-cliff.outputs.changelog }})
r="${r//'%'/'%25'}" # Multiline escape sequences for %
r="${r//$'\n'/'%0A'}" # Multiline escape sequences for '\n'
r="${r//$'\r'/'%0D'}" # Multiline escape sequences for '\r'
echo "::set-output name=RELEASE_BODY::$r"
- name: Create the release on github
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release v${{ env.RELEASE_VERSION }}
body: ${{ steps.release.outputs.RELEASE_BODY }}
draft: false
prerelease: false