-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (77 loc) · 2.53 KB
/
lein-test.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
name: Action for lein repo test
on:
workflow_call:
inputs:
clojureRepo:
description: "Repository name with owner."
type: string
required: true
clojureRef:
description: "The branch, tag or SHA to checkout"
type: string
required: true
subjectRepo:
description: "Subject Repository name with owner."
type: string
required: true
subjectRef:
description: "The branch, tag or SHA to checkout for subject repo"
type: string
required: true
javaVersion:
description: 'Java matrix versions to use for the build'
required: false
default: '["8", "11", "17", "21"]'
type: string
testCmd:
description: "Command to invoke test run"
type: string
required: false
default: 'lein test'
jobs:
test:
strategy:
matrix:
java-version: ${{ fromJson(inputs.javaVersion) }}
runs-on: ubuntu-latest
steps:
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
- name: Checkout Clojure Source Code
uses: actions/checkout@v4
with:
repository: ${{ inputs.clojureRepo }}
ref: ${{ inputs.clojureRef }}
path: 'clojure-source'
- name: Build Clojure from Source
run: |
cd clojure-source
mvn install -ntp -Dmaven.test.skip=true
- name: Checkout Regression Test Source Code
uses: actions/checkout@v4
with:
repository: clojure/test.regression
ref: 'main'
path: 'test-source'
- name: Determine latest snapshot version
run: |
chmod +x ./test-source/scripts/find-installed-clojure-version.sh
./test-source/scripts/find-installed-clojure-version.sh
- name: Checkout Subject Source Code
uses: actions/checkout@v4
with:
repository: ${{ inputs.subjectRepo }}
ref: ${{ inputs.subjectRef }}
path: 'subject-source'
- name: Install Leiningen
run: |
wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
chmod +x lein
sudo mv lein /usr/local/bin/
cd /home/runner/work/test.regression/test.regression/subject-source
lein deps
sed -i.bak "s/\(org.clojure\/clojure\ \"[0-9\.]*\"\)/org.clojure\/clojure \"${{ env.LATEST_CLJ_BUILD }}\"/g" project.clj
${{ inputs.testCmd }}