You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: .github/workflows/test.yml
+17-44
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
name: Test
2
+
2
3
on:
3
4
push:
4
5
branches:
@@ -10,7 +11,6 @@ on:
10
11
- '**.md'
11
12
12
13
jobs:
13
-
14
14
build:
15
15
name: Build
16
16
@@ -23,12 +23,12 @@ jobs:
23
23
24
24
steps:
25
25
- name: Checkout
26
-
uses: actions/checkout@v3
26
+
uses: actions/checkout@v4
27
27
28
-
- name: Setup Node 16
29
-
uses: actions/setup-node@v3
28
+
- name: Setup Node 20
29
+
uses: actions/setup-node@v4
30
30
with:
31
-
node-version: 16.x
31
+
node-version: 20.x
32
32
cache: 'npm'
33
33
34
34
- name: Install dependencies
@@ -54,43 +54,36 @@ jobs:
54
54
mkdir -p path/to/dir-3
55
55
echo "Lorem ipsum dolor sit amet" > path/to/dir-1/file1.txt
56
56
echo "Hello world from file #2" > path/to/dir-2/file2.txt
57
-
echo "This is a going to be a test for a large enough file that should get compressed with GZip. The @actions/artifact package uses GZip to upload files. This text should have a compression ratio greater than 100% so it should get uploaded using GZip" > path/to/dir-3/gzip.txt
58
57
59
58
# Upload a single file artifact
60
59
- name: 'Upload artifact #1'
61
60
uses: ./
62
61
with:
63
-
name: 'Artifact-A'
62
+
name: 'Artifact-A-${{ matrix.runs-on }}'
64
63
path: path/to/dir-1/file1.txt
65
64
66
-
# Upload using a wildcard pattern, name should default to 'artifact' if not provided
65
+
# Upload using a wildcard pattern
67
66
- name: 'Upload artifact #2'
68
67
uses: ./
69
68
with:
69
+
name: 'Artifact-Wildcard-${{ matrix.runs-on }}'
70
70
path: path/**/dir*/
71
71
72
-
# Upload a directory that contains a file that will be uploaded with GZip
72
+
# Upload a multi-path artifact
73
73
- name: 'Upload artifact #3'
74
74
uses: ./
75
75
with:
76
-
name: 'GZip-Artifact'
77
-
path: path/to/dir-3/
78
-
79
-
# Upload a directory that contains a file that will be uploaded with GZip
80
-
- name: 'Upload artifact #4'
81
-
uses: ./
82
-
with:
83
-
name: 'Multi-Path-Artifact'
76
+
name: 'Multi-Path-Artifact-${{ matrix.runs-on }}'
84
77
path: |
85
78
path/to/dir-1/*
86
79
path/to/dir-[23]/*
87
80
!path/to/dir-3/*.txt
88
81
89
82
# Download Artifact #1 and verify the correctness of the content
90
83
- name: 'Download artifact #1'
91
-
uses: actions/download-artifact@v3
84
+
uses: actions/download-artifact@v4-beta
92
85
with:
93
-
name: 'Artifact-A'
86
+
name: 'Artifact-A-${{ matrix.runs-on }}'
94
87
path: some/new/path
95
88
96
89
- name: 'Verify Artifact #1'
@@ -108,9 +101,9 @@ jobs:
108
101
109
102
# Download Artifact #2 and verify the correctness of the content
110
103
- name: 'Download artifact #2'
111
-
uses: actions/download-artifact@v3
104
+
uses: actions/download-artifact@v4-beta
112
105
with:
113
-
name: 'artifact'
106
+
name: 'Artifact-Wildcard-${{ matrix.runs-on }}'
114
107
path: some/other/path
115
108
116
109
- name: 'Verify Artifact #2'
@@ -127,31 +120,11 @@ jobs:
127
120
}
128
121
shell: pwsh
129
122
130
-
# Download Artifact #3 and verify the correctness of the content
131
-
- name: 'Download artifact #3'
132
-
uses: actions/download-artifact@v3
133
-
with:
134
-
name: 'GZip-Artifact'
135
-
path: gzip/artifact/path
136
-
137
-
# Because a directory was used as input during the upload the parent directories, path/to/dir-3/, should not be included in the uploaded artifact
138
-
- name: 'Verify Artifact #3'
139
-
run: |
140
-
$gzipFile = "gzip/artifact/path/gzip.txt"
141
-
if(!(Test-Path -path $gzipFile))
142
-
{
143
-
Write-Error "Expected file do not exist"
144
-
}
145
-
if(!((Get-Content $gzipFile) -ceq "This is a going to be a test for a large enough file that should get compressed with GZip. The @actions/artifact package uses GZip to upload files. This text should have a compression ratio greater than 100% so it should get uploaded using GZip"))
146
-
{
147
-
Write-Error "File contents of downloaded artifact is incorrect"
148
-
}
149
-
shell: pwsh
150
-
123
+
# Download Artifact #4 and verify the correctness of the content
0 commit comments