-
Notifications
You must be signed in to change notification settings - Fork 9
66 lines (58 loc) · 1.75 KB
/
build_test_pr.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
name: "Pull Request Build & Test"
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
distribution: corretto
java-version: 8
- name: Restore local Maven repository from cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles( 'project.clj' ) }}
restore-keys: |
${{ runner.os }}-maven-
- name: Validate SNAPSHOT version
env:
SNAPSHOT_REGEX: ^[0-9]{1,2}[.][0-9]{1,2}[.][0-9]{1,3}-SNAPSHOT$
if: github.ref != 'refs/heads/master'
run: |
lein pom
export VERSION=$(less pom.xml | grep "<version>" | head -1 | cut -d ">" -f2 | cut -d "<" -f1)
echo "Version is:" $VERSION
if [[ !("$VERSION" =~ $SNAPSHOT_REGEX) ]]
then
echo "Version isn't a SNAPSHOT version:" $VERSION
exit 0
fi
- name: Setup linter
uses: DeLaGuardo/setup-clj-kondo@master
with:
version: '2023.09.07'
- name: Lint
run: clj-kondo --lint src test --config '{:lint-as {clojure.test.check.properties/for-all clojure.core/let}}'
test:
needs: build
uses: ./.github/workflows/test.yml
event_file:
needs: test
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v2
with:
name: Event File
path: ${{ github.event_path }}