-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
67 lines (58 loc) · 1.72 KB
/
action.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
name: 'create-report'
description: 'An action to create a generic run report'
branding:
icon: 'file-text'
color: 'green'
# TODO: Specify version
inputs:
title:
description: "Title of the report"
required: true
path:
description: "File path of the report."
required: false
format:
description: "The data format of the summary either markdown or html."
required: false
default: "markdown"
runs:
using: "composite"
steps:
- name: Cache Pip
id: pip-cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ env.GITHUB_ACTION_PATH }}-pip-cache
- uses: fwal/setup-swift@v1.22.0
with:
swift-version: "5.7"
- uses: actions/setup-python@v2
with:
python-version: '3.8.12'
cache: 'pip'
- run: pip install -r $GITHUB_ACTION_PATH/requirements.txt
if: steps.pip-cache.outputs.cache-hit != 'true'
shell: bash
- name: Cache ghchecks
id: ghchecks-cache
uses: actions/cache@v3
with:
path: /usr/local/bin/ghchecks
key: ${{ runner.os }}-${{ env.GITHUB_ACTION_PATH }}-ghchecks-cache
- if: steps.ghchecks-cache.outputs.cache-hit != 'true'
run: |
cd $GITHUB_ACTION_PATH
swift build -c release && \
cp .build/release/ghchecks /usr/local/bin/ghchecks
shell: bash
- name: Create report
run: |
ghchecks create-report \
--title "${{ inputs.title }} " \
--path "${{ inputs.path }}" \
--format "${{ inputs.format }}" \
--repository "${{ github.repository }}" \
--head-sha "${{ github.event.pull_request.head.sha }}" \
--github-token "${{ github.token }}"
shell: bash