-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (53 loc) · 1.57 KB
/
ci.yaml
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
name: Tests
on:
pull_request:
push:
branches:
- main
tags:
- '*'
jobs:
test:
name: Test scalafix rules
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
with:
jvm: temurin:17
apps: scala-cli:1.2.0
- name: Test rules
run: sbt "+test"
- name: Test outputs
run: |
tests=src/main/scala/test
for file in Example1.scala Example2.scala ; do
scala-cli run input/build.scala input/$tests/$file > input.out
scala-cli run output/build.scala output/$tests/$file > output.out
diff input.out output.out && echo "Test $file - ok" || exit 1
done
- name: Test circe-generic-extern tests
run: |
scala-cli test input
scala-cli test output
publish_release:
runs-on: [ubuntu-22.04]
needs: [test]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
steps:
- uses: coursier/setup-action@v1
with:
jvm: temurin:8
- uses: actions/checkout@v4
- name: Setup PGP Key
run: |
echo -n "$PGP_SECRET" | base64 --decode | gpg --batch --import
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
- name: Publish release
env:
PGP_PW: ${{ secrets.PGP_PW }}
SONATYPE_PW: ${{ secrets.MAVEN_PASSWORD }}
SONATYPE_USER: ${{ secrets.MAVEN_USER }}
run: sbt "+rules/publishSigned; sonatypeBundleRelease"