-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathaction.yml
48 lines (42 loc) · 1.24 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
name: "Elixir Coverage"
description: "Action to run tests, check coverage, and send a feedback message to the pull request."
branding:
icon: "message-square"
color: "purple"
inputs:
github_token:
description: "GitHub token"
required: true
coverage_threshold:
description: "Coverage threshold"
default: 90
required: false
working_directory:
description: "Working directory"
default: "."
required: false
runs:
using: "composite"
steps:
- name: Tests and coverage
id: tests
shell: bash
run: |
cd ${{ inputs.working_directory }}
if mix test --cover 2>&1 | tee coverage_report.log; then echo 'success running the tests'; fi
- name: Feedback comment
uses: actions/github-script@v7
with:
github-token: ${{ inputs.github_token }}
script: |
const actionPath = '${{ github.action_path }}';
const actor = '${{ github.actor }}';
const script = require(`${actionPath}/main.js`);
await script({
core,
actor,
github,
context,
coverageThreshold: ${{ inputs.coverage_threshold }},
workingDirectory: '${{ inputs.working_directory }}',
});