-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (57 loc) · 1.68 KB
/
tests.yml
File metadata and controls
63 lines (57 loc) · 1.68 KB
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
name: tests
on:
workflow_call: # allow invocation from publish
push:
branches:
- "**"
tags:
- "!**" # only the publish flow triggers on tags
pull_request:
# default activity types are: synchronize, opened, reopened
# remove synchronize to avoid double triggering on PRs commits (push trigger is enough)
types:
- opened
- synchronize # add back in to explore...
- reopened
jobs:
checks:
runs-on: ubuntu-latest
outputs:
run_tests: ${{ steps.checks.outputs.run_tests }}
steps:
- name: Checkout
uses: actions/checkout@v3
# TODO: needed?
with:
fetch-depth: 0
- name: Install Babashka
uses: DeLaGuardo/setup-clojure@10.2
with:
bb: 'latest'
- name: Checks
id: checks
env:
GH_TOKEN: ${{ github.token }}
# I'm not sure how to properly share a subset of the github context yet, for now avoid
# security and command-line escaping by sharing via env vars
EVENT_NAME: ${{ github.event_name }}
REPO: ${{ github.repository }}
REF: ${{ github.ref }}
COMMIT_SHA: ${{ github.sha }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
bb script/ci_create_check_vars.clj
test:
needs: [checks]
# the publish flow commits version changes, we don't want that, on its own, to trigger a test run
# but we do need tests to run if invoked by publish
if: ${{ needs.checks.outputs.run_tests == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run tests
run: |
echo "Testing 123"