-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
37 lines (37 loc) · 1.08 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
name: 'Upload Coverage'
description: 'Uploade coverage file for later composing'
inputs:
file:
description: 'Coverage file name'
required: false
default: '.coverage'
artifact:
description: 'The artifact name to store coverage chunk'
required: false
default: 'coverage'
runs:
using: "composite"
steps:
- name: Calculate metadata
id: meta
run: |
import os, secrets
rnd = secrets.token_hex(16)
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
print(f"file=.coverage.{rnd}", file=f)
art = os.environ["ARTIFACT"]
print(f"artifact={art}-{rnd}", file=f)
env:
ARTIFACT: ${{ inputs.artifact }}
shell: python
- name: Rename file
run: mv ${{ inputs.file }} ${{ steps.meta.outputs.file }}
shell: bash
- name: Upload coverage artifact
uses: actions/[email protected]
with:
name: ${{ steps.meta.outputs.artifact }}
path: ${{ steps.meta.outputs.file }}
if-no-files-found: error
retention-days: 1
include-hidden-files: true