8
8
push :
9
9
branches : [main]
10
10
pull_request :
11
+ types :
12
+ - opened
13
+ - reopened
14
+ - synchronize
15
+ - ready_for_review
16
+
17
+ concurrency :
18
+ group : ${{ github.workflow }}-${{ github.ref }}
19
+ cancel-in-progress : true
20
+
21
+ env :
22
+ USE_RUBY : ${{ vars.USE_RUBY || 'false' }}
23
+ USE_YQ : ${{ vars.USE_YQ || 'false' }}
24
+ USE_CACHE : ${{ vars.USE_CACHE || 'false' }}
25
+ CACHE_FOLDER : ${{ vars.CACHE_FOLDER || '.cache' }}
11
26
12
27
jobs :
13
28
test :
14
- if : " !contains(github.event.head_commit.message, 'skip ci')"
29
+ if : ${{ !contains(github.event.head_commit.message, 'skip ci') && !github.event.pull_request.draft}}
15
30
runs-on : ubuntu-latest
16
31
steps :
17
32
- name : Checkout project (pull-request)
@@ -28,10 +43,12 @@ jobs:
28
43
with :
29
44
java-version : adopt@1.11
30
45
- name : Setup Ruby
46
+ if : ${{ env.USE_RUBY == 'true' }}
31
47
uses : ruby/setup-ruby@v1
32
48
with :
33
49
ruby-version : .ruby-version
34
50
- name : Setup yq
51
+ if : ${{ env.USE_YQ == 'true' }}
35
52
run : sudo snap install yq
36
53
- name : Run pre-conditions
37
54
run : test -f .github/actions.yml && eval "$(yq e '.pre.ci // "true"' .github/actions.yml)" || true
@@ -42,10 +59,26 @@ jobs:
42
59
uses : stefanzweifel/git-auto-commit-action@v4.5.1
43
60
with :
44
61
commit_message : Run formatter/linter
62
+ - name : Restore cache
63
+ id : ci-cache-restore
64
+ if : ${{ env.USE_CACHE == 'true' }}
65
+ uses : actions/cache/restore@v3
66
+ with :
67
+ path : |
68
+ ${{ env.CACHE_FOLDER }}
69
+ key : ci-cache-key
45
70
- name : Run checks
46
71
run : sbt ci-test
47
72
env :
48
73
GITHUB_TOKEN : ${{ secrets.ADMIN_GITHUB_TOKEN }}
74
+ - name : Save cache
75
+ id : ci-cache-save
76
+ if : ${{ env.USE_CACHE == 'true' }}
77
+ uses : actions/cache/save@v3
78
+ with :
79
+ path : |
80
+ ${{ env.CACHE_FOLDER }}
81
+ key : ${{ steps.ci-cache-restore.outputs.cache-primary-key }}
49
82
- name : Run post-conditions
50
83
run : test -f .github/actions.yml && eval "$(yq e '.post.ci // "true"' .github/actions.yml)" || true
51
84
- name : Automerge Scala Steward PRs
0 commit comments