Skip to content

Commit cdc6f85

Browse files
[Github] Add Workflow to test Unprivileged Download Artifact Action
Since this is a composite action, we do not get any testing currently when updating the action. This patch adds a simple workflow to test the action so we can ensure we do not break it when modifying it. Reviewers: tstellar Reviewed By: tstellar Pull Request: llvm#167434
1 parent 86fa018 commit cdc6f85

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Test Unprivileged Download Artifact Action
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- .github/workflows/test-unprivileged-download-artifact.yml
12+
- '.github/workflows/unprivileged-download-artifact/**'
13+
pull_request:
14+
paths:
15+
- .github/workflows/test-unprivileged-download-artifact.yml
16+
- '.github/workflows/unprivileged-download-artifact/**'
17+
18+
jobs:
19+
upload-test-artifact:
20+
name: Upload Test Artifact
21+
if: github.repository_owner == 'llvm'
22+
runs-on: ubuntu-24.04
23+
steps:
24+
- name: Create Test File
25+
run: |
26+
echo "test" > comment
27+
- name: Upload Test File
28+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
29+
with:
30+
name: workflow-args
31+
path: |
32+
comment
33+
34+
test-download:
35+
name: Test Unprivileged Download Artifact
36+
if: github.repository_owner == 'llvm'
37+
runs-on: ubuntu-24.04
38+
needs: [ upload-test-artifact ]
39+
steps:
40+
- name: Chekcout LLVM
41+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
42+
with:
43+
sparse-checkout: |
44+
.github/workflows/unprivileged-download-artifact/action.yml
45+
- name: Download Artifact
46+
uses: ./.github/workflows/unprivileged-download-artifact
47+
id: download-artifact
48+
with:
49+
run-id: ${{ github.run_id }}
50+
artifact-name: workflow-args
51+
- name: Assert That Contents are the Same
52+
run: |
53+
cat comment
54+
[[ "$(cat comment)" == "test" ]]

0 commit comments

Comments
 (0)