-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.yaml
47 lines (42 loc) · 1.45 KB
/
example.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
name: Scala formatter
on:
push:
branches: [ main ]
paths:
- '**.scala'
pull_request:
branches: [ main ]
paths:
- '**.scala'
jobs:
scalafmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: dorny/paths-filter@v2
id: filter
with:
# Enable listing of files matching each filter.
# Paths to files will be available in `${FILTER_NAME}_files` output variable.
# Paths will be escaped and space-delimited.
# Output is usable as command-line argument list in Linux shell
list-files: shell
fetch-depth: 10
# In this example changed files will be checked by linter.
# It doesn't make sense to lint deleted files.
# Therefore we specify we are only interested in added or modified files.
filters: |
scala:
- added|modified: '**.scala'
- name: Check for scalafmt conformance
if: ${{ steps.filter.outputs.scala == 'true' }}
run: |
VERSION=3.5.8
INSTALL_LOCATION=/usr/bin/scalafmt-native
curl https://raw.githubusercontent.com/scalameta/scalafmt/master/bin/install-scalafmt-native.sh | \
sudo bash -s -- $VERSION $INSTALL_LOCATION
scalafmt-native --help
echo "---------------------------------------------------"
scalafmt-native ${{ steps.filter.outputs.scala_files }} --check --reportError