mirror of
https://github.com/actions/setup-dotnet.git
synced 2026-03-22 06:32:24 +08:00
Compare commits
554 Commits
releases/v
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac1e138303 | ||
|
|
16c7b3c2fa | ||
|
|
131b410979 | ||
|
|
baa11fbfe1 | ||
|
|
24ec4f204b | ||
|
|
4c100cb5e4 | ||
|
|
25328d894d | ||
|
|
937b8dd381 | ||
|
|
2016bd2012 | ||
|
|
21e81f65dd | ||
|
|
740310365d | ||
|
|
d4c94342e5 | ||
|
|
5c125af7da | ||
|
|
87c6e11776 | ||
|
|
06a5327ecf | ||
|
|
e8e5b8203e | ||
|
|
bf4cd79173 | ||
|
|
4ddad1c881 | ||
|
|
0f55b457d2 | ||
|
|
267870a9c4 | ||
|
|
67a3573c9a | ||
|
|
83c0c1a6c8 | ||
|
|
3951f0dfe7 | ||
|
|
4849e736f1 | ||
|
|
3e76c4dc41 | ||
|
|
91b379339b | ||
|
|
4b37d22250 | ||
|
|
f9d0f6282c | ||
|
|
87b7050bc5 | ||
|
|
e4c228a841 | ||
|
|
3e891b0cb6 | ||
|
|
2e0b25913c | ||
|
|
29640e4139 | ||
|
|
cbeba61921 | ||
|
|
344ba5f715 | ||
|
|
9be03d3dab | ||
|
|
dbebe359e4 | ||
|
|
6bd8b7f777 | ||
|
|
5d1464d5da | ||
|
|
3e6b9fe393 | ||
|
|
769316e2e4 | ||
|
|
4d6c8fcf3c | ||
|
|
2216f56ae1 | ||
|
|
736bc6dea6 | ||
|
|
f5526c2d1b | ||
|
|
4dba25fa31 | ||
|
|
ada8800330 | ||
|
|
e1749123a8 | ||
|
|
a6be55a915 | ||
|
|
9b40770825 | ||
|
|
48277343a5 | ||
|
|
70fa3206c9 | ||
|
|
7ed547ca75 | ||
|
|
b5ebe9e10a | ||
|
|
89f1766d87 | ||
|
|
d1c99df34e | ||
|
|
faa708d00b | ||
|
|
ea6d1c26e7 | ||
|
|
9471c5df0b | ||
|
|
6eb2af61b6 | ||
|
|
8f71719d12 | ||
|
|
3cdb09485a | ||
|
|
6019612129 | ||
|
|
addb470701 | ||
|
|
820f30d332 | ||
|
|
427804d76a | ||
|
|
89b480a0df | ||
|
|
defac2491f | ||
|
|
916aec40c9 | ||
|
|
3447fd6a9f | ||
|
|
916351aac9 | ||
|
|
1ad2e312fa | ||
|
|
e3f84b8f7a | ||
|
|
2785e21d5e | ||
|
|
80a318b8b8 | ||
|
|
eb0b7f8852 | ||
|
|
5c7ae4f903 | ||
|
|
b7461a1b69 | ||
|
|
cce8e1bad1 | ||
|
|
df506c2d9c | ||
|
|
abf9166e44 | ||
|
|
7e164d3c3b | ||
|
|
3dfe2673eb | ||
|
|
ba848a34bb | ||
|
|
aa983c550d | ||
|
|
b891376106 | ||
|
|
b05a3f26b3 | ||
|
|
5fdecd2063 | ||
|
|
38b49fb717 | ||
|
|
3cf3e230c1 | ||
|
|
83a1653fa3 | ||
|
|
898aa0ce4d | ||
|
|
2f028bc044 | ||
|
|
21cf89aa73 | ||
|
|
fefaa59d2e | ||
|
|
e8501859aa | ||
|
|
426d75d071 | ||
|
|
0f534f5829 | ||
|
|
fbdbede901 | ||
|
|
0bc43909e0 | ||
|
|
aa85432603 | ||
|
|
6d92b9bd53 | ||
|
|
dd32dd730c | ||
|
|
c5a57b219c | ||
|
|
6adeb768ce | ||
|
|
f425be78f5 | ||
|
|
fc8786b149 | ||
|
|
7d08dc7593 | ||
|
|
e0a32d6459 | ||
|
|
255362be61 | ||
|
|
50b46b3b1d | ||
|
|
e8ac21d503 | ||
|
|
a79ce57e6b | ||
|
|
180a15970f | ||
|
|
b72f430d36 | ||
|
|
559e47b01b | ||
|
|
7358a44590 | ||
|
|
34c30d0e81 | ||
|
|
5f570676c2 | ||
|
|
aa34a3ceaa | ||
|
|
12f70884d7 | ||
|
|
0318091611 | ||
|
|
f199d27aa1 | ||
|
|
660c25a321 | ||
|
|
4f6b2f576a | ||
|
|
920b830bd1 | ||
|
|
abdd14ee80 | ||
|
|
1d9f0dad5b | ||
|
|
2699274f6e | ||
|
|
ca579e0fb2 | ||
|
|
c82240598b | ||
|
|
926f442022 | ||
|
|
c41fd15071 | ||
|
|
0c8652569e | ||
|
|
3cf27f13bb | ||
|
|
ae8edb8fff | ||
|
|
82b2b40816 | ||
|
|
fe74f1cb7d | ||
|
|
e94d154672 | ||
|
|
fe67d2f8db | ||
|
|
023f7252a0 | ||
|
|
3f3ad54c0c | ||
|
|
e1d35446fe | ||
|
|
11aaa65761 | ||
|
|
13abe4777e | ||
|
|
aefe5b483f | ||
|
|
047f06d086 | ||
|
|
014f8c8384 | ||
|
|
80c862dc38 | ||
|
|
e21107efbd | ||
|
|
d8f1ab14a7 | ||
|
|
f05a62b1cc | ||
|
|
338d4e3bbf | ||
|
|
228eec3014 | ||
|
|
c483e03222 | ||
|
|
a35f420124 | ||
|
|
4214866121 | ||
|
|
0681939502 | ||
|
|
ba8a1f9c02 | ||
|
|
09d024bd02 | ||
|
|
8ae4c080ce | ||
|
|
c5d2f92cae | ||
|
|
069c35efca | ||
|
|
6a2cd88ae8 | ||
|
|
9984a6fa87 | ||
|
|
607fce577a | ||
|
|
501b34e8f6 | ||
|
|
b827fcce4d | ||
|
|
239baf3c5b | ||
|
|
4d4a70f4a5 | ||
|
|
70c3f4d098 | ||
|
|
9260643816 | ||
|
|
45c9f236cf | ||
|
|
6d6c7c9313 | ||
|
|
e753bbf2ff | ||
|
|
629365b26e | ||
|
|
942a0bea39 | ||
|
|
26db2473e9 | ||
|
|
467621733d | ||
|
|
bdd38d13dc | ||
|
|
1d2f8f9eaf | ||
|
|
354d280fa3 | ||
|
|
0ff311b0d0 | ||
|
|
bc65ba63d3 | ||
|
|
90642fa8c5 | ||
|
|
c7e7147fd3 | ||
|
|
cf081e76a2 | ||
|
|
4ca3c96b49 | ||
|
|
0705ef0281 | ||
|
|
a351d9ea84 | ||
|
|
cc76dfab99 | ||
|
|
857c316a9d | ||
|
|
1f2c90bb99 | ||
|
|
251997c37d | ||
|
|
bba8299c35 | ||
|
|
fd4e15fa44 | ||
|
|
95e7de77d1 | ||
|
|
52c3199a78 | ||
|
|
2d9def7067 | ||
|
|
df51eabf53 | ||
|
|
e4b2fcaa19 | ||
|
|
d45c10e6f7 | ||
|
|
4d1b6c2c63 | ||
|
|
5d7bc0454b | ||
|
|
792e988dae | ||
|
|
e5034212c9 | ||
|
|
0997db20d4 | ||
|
|
4cb4764ae2 | ||
|
|
d33e605efe | ||
|
|
f7747565a1 | ||
|
|
2f75d1de25 | ||
|
|
e6a9a96293 | ||
|
|
025aba53b2 | ||
|
|
37b00c4fc5 | ||
|
|
c2dac7f367 | ||
|
|
c5267f5e54 | ||
|
|
ba5e53c61d | ||
|
|
043fb8900f | ||
|
|
cb04ff8cb3 | ||
|
|
bac4044d91 | ||
|
|
d26ead4cf0 | ||
|
|
e81cd4d454 | ||
|
|
ee11c4faa4 | ||
|
|
8bf1fb6084 | ||
|
|
c0d4ad69d8 | ||
|
|
afe2daba1f | ||
|
|
fb09b12527 | ||
|
|
5cc895510b | ||
|
|
158737d5b1 | ||
|
|
fcf565ec50 | ||
|
|
f078482971 | ||
|
|
0fb87b12d2 | ||
|
|
4fe7a196b5 | ||
|
|
9283a8cf7a | ||
|
|
53d632b5c0 | ||
|
|
9211491ffb | ||
|
|
edfd7b3266 | ||
|
|
9744af7b74 | ||
|
|
7016f85f93 | ||
|
|
d292011f5d | ||
|
|
608ee757cf | ||
|
|
e54e706650 | ||
|
|
c20f59e04a | ||
|
|
13b852df87 | ||
|
|
f85bcda870 | ||
|
|
499789684c | ||
|
|
76ddd67c90 | ||
|
|
550702114f | ||
|
|
e3ce4164b3 | ||
|
|
463326422f | ||
|
|
547d075822 | ||
|
|
fc9265379f | ||
|
|
32c76e2669 | ||
|
|
8ca0cf75a1 | ||
|
|
7f88dbf08f | ||
|
|
af0ed6536b | ||
|
|
9dd9d27e57 | ||
|
|
44530e8569 | ||
|
|
5a3fa01c67 | ||
|
|
f2da928c08 | ||
|
|
fb9fd97b03 | ||
|
|
f0b9e4cf3f | ||
|
|
b66058b059 | ||
|
|
7323c4e7cb | ||
|
|
6eab455d72 | ||
|
|
b2cf6c7cd4 | ||
|
|
ff5b78971e | ||
|
|
e26fc623bc | ||
|
|
e974974b42 | ||
|
|
9969bca445 | ||
|
|
deee0f6246 | ||
|
|
33fad1d142 | ||
|
|
2c3efd1f04 | ||
|
|
f3822c3b02 | ||
|
|
5e45b4b591 | ||
|
|
b7b99f337e | ||
|
|
f92687c910 | ||
|
|
0067f023d2 | ||
|
|
9480036ff9 | ||
|
|
6b8ad2e725 | ||
|
|
078f7c4a73 | ||
|
|
13fd5bf191 | ||
|
|
26be14c4e1 | ||
|
|
8309d4ee7e | ||
|
|
bab14f40fd | ||
|
|
4b337272b7 | ||
|
|
d62c876481 | ||
|
|
5306333434 | ||
|
|
5070486392 | ||
|
|
9647326bcf | ||
|
|
f720d14d91 | ||
|
|
7f3ad75595 | ||
|
|
634914df32 | ||
|
|
4fc55d8fdb | ||
|
|
c98cd238db | ||
|
|
b25fa305a3 | ||
|
|
181f10df92 | ||
|
|
c65a26fe6d | ||
|
|
dd9ada314c | ||
|
|
12194cb2cd | ||
|
|
b8ab602c41 | ||
|
|
95f03216f8 | ||
|
|
5529ce4143 | ||
|
|
5b0ff19756 | ||
|
|
bf3c3eb1fd | ||
|
|
450b569534 | ||
|
|
e1cf912aaf | ||
|
|
03d6eb5402 | ||
|
|
effa3e26d2 | ||
|
|
a71d1eb2c8 | ||
|
|
b50d70502b | ||
|
|
d8cff32ae5 | ||
|
|
7b2009794e | ||
|
|
53d6483af8 | ||
|
|
34c59b7d0b | ||
|
|
bd485b6bd1 | ||
|
|
0cfae9b3a5 | ||
|
|
23fa2c1473 | ||
|
|
291588df6a | ||
|
|
87189a16c7 | ||
|
|
cde58ab948 | ||
|
|
20e68089c2 | ||
|
|
7790315509 | ||
|
|
c47e26f841 | ||
|
|
3edf2e9363 | ||
|
|
a8c97016ef | ||
|
|
07b4a80293 | ||
|
|
d08d2193f9 | ||
|
|
632ccbdfb9 | ||
|
|
b81836a248 | ||
|
|
3b539379a8 | ||
|
|
596753d72c | ||
|
|
f9d7f16c00 | ||
|
|
56d96e897e | ||
|
|
5a201f5e82 | ||
|
|
13ccc115f4 | ||
|
|
f2eb44dadd | ||
|
|
8dcf1ee9bc | ||
|
|
3707a44789 | ||
|
|
385512c5e5 | ||
|
|
083d63a2ff | ||
|
|
6930747f7f | ||
|
|
20afff9c90 | ||
|
|
36fa9877a9 | ||
|
|
77a48bbb85 | ||
|
|
4f71fcfa81 | ||
|
|
768b4eb7db | ||
|
|
ba7e1e2155 | ||
|
|
6803d4b94d | ||
|
|
3c80e97cbd | ||
|
|
8d30c127da | ||
|
|
2d101adc9f | ||
|
|
c8b60fb6bf | ||
|
|
bea420f2fd | ||
|
|
3a3dbe976e | ||
|
|
ce38f90a9a | ||
|
|
c32ed2108b | ||
|
|
d99c06115d | ||
|
|
f311b6d978 | ||
|
|
9427b17c42 | ||
|
|
f39691d155 | ||
|
|
19e6ad3fe0 | ||
|
|
efeb86e5ce | ||
|
|
8e5c71c8f8 | ||
|
|
c0d7255256 | ||
|
|
c1ca14bb7b | ||
|
|
e1655545c1 | ||
|
|
2a58294d0c | ||
|
|
92ffa484b1 | ||
|
|
3698118d95 | ||
|
|
cfb7e25be1 | ||
|
|
5865234247 | ||
|
|
0cb99b2a12 | ||
|
|
4a01d86a5b | ||
|
|
1c7be1087d | ||
|
|
ac1baccba4 | ||
|
|
92451e3d46 | ||
|
|
a841c568fd | ||
|
|
5d1a72cb19 | ||
|
|
8889c6748f | ||
|
|
f4159a6d20 | ||
|
|
7164f75e01 | ||
|
|
44b8627225 | ||
|
|
054db1cac2 | ||
|
|
1317beb53a | ||
|
|
fabe7d52fe | ||
|
|
993f819e3d | ||
|
|
831e0d4070 | ||
|
|
bb2233aaa5 | ||
|
|
24ed2d0102 | ||
|
|
059f1aa99b | ||
|
|
5c5ac76dc6 | ||
|
|
a0f70ab98c | ||
|
|
5dcd27b0bc | ||
|
|
79735df611 | ||
|
|
a1105722ad | ||
|
|
131ac602dc | ||
|
|
c8cb48ba8b | ||
|
|
7bbfec324f | ||
|
|
6b7d951977 | ||
|
|
c7eaa2ec00 | ||
|
|
8807004b20 | ||
|
|
2d640ec739 | ||
|
|
53b5bae1f6 | ||
|
|
45c0959fcd | ||
|
|
d33a835564 | ||
|
|
347456b934 | ||
|
|
76a91b1af8 | ||
|
|
9d49fb8e98 | ||
|
|
10ad86dc12 | ||
|
|
71f0d4bd07 | ||
|
|
7669e56997 | ||
|
|
c8cf369c29 | ||
|
|
6ade6c061b | ||
|
|
843b5197ce | ||
|
|
a3d47e556c | ||
|
|
7261940ea5 | ||
|
|
8ada5b5558 | ||
|
|
62230c5409 | ||
|
|
51b6fb2610 | ||
|
|
c47b497cff | ||
|
|
975b958e4c | ||
|
|
13bccd131e | ||
|
|
daad66578a | ||
|
|
29c0c6cee8 | ||
|
|
5551aab1c3 | ||
|
|
9a46dbb681 | ||
|
|
9fdd50a4bb | ||
|
|
8336fd394b | ||
|
|
51f68377c1 | ||
|
|
7a98346f51 | ||
|
|
8aad93f856 | ||
|
|
9d7c66c348 | ||
|
|
a1c7110c2a | ||
|
|
352338157c | ||
|
|
3569a93d9f | ||
|
|
985d576ba0 | ||
|
|
52dbd90938 | ||
|
|
d50c2980a5 | ||
|
|
b409ac80d1 | ||
|
|
4f53c95c39 | ||
|
|
bc0200672b | ||
|
|
3fdf140cf1 | ||
|
|
221e7bcc3b | ||
|
|
37b9e8b54a | ||
|
|
bedd981d16 | ||
|
|
422ae8cdee | ||
|
|
e3d81d9453 | ||
|
|
c7a4f4e270 | ||
|
|
55885b7a99 | ||
|
|
7a84008633 | ||
|
|
b8681684f4 | ||
|
|
908a1a8267 | ||
|
|
9e01770f11 | ||
|
|
9bdaa47c80 | ||
|
|
7621179156 | ||
|
|
81ca5f786c | ||
|
|
257d9b2a19 | ||
|
|
61ee7d7a72 | ||
|
|
3af4b91f2c | ||
|
|
fe319a6b7f | ||
|
|
20a4db787c | ||
|
|
80a21d447c | ||
|
|
4114018c87 | ||
|
|
7df9f59802 | ||
|
|
a4ec20650e | ||
|
|
b7a80c5d92 | ||
|
|
3648b37cf8 | ||
|
|
73683e5d2f | ||
|
|
232f64b253 | ||
|
|
5091cc16d9 | ||
|
|
a40afdb08e | ||
|
|
3c9d15de90 | ||
|
|
400e687804 | ||
|
|
8388fb6ff7 | ||
|
|
6efb2bd78f | ||
|
|
e169331466 | ||
|
|
40390722c2 | ||
|
|
fe5534da38 | ||
|
|
983c8ef1bd | ||
|
|
a8eaac54ab | ||
|
|
82b9a8ff02 | ||
|
|
392189ddd3 | ||
|
|
db2ebd0903 | ||
|
|
7895df17cc | ||
|
|
308b9ff32c | ||
|
|
a0982bfd3a | ||
|
|
994f136361 | ||
|
|
7b228edf43 | ||
|
|
3894eede2d | ||
|
|
3de417d35c | ||
|
|
c5ee7a1134 | ||
|
|
4051f74532 | ||
|
|
3eb0d2f3dd | ||
|
|
08fb271bd7 | ||
|
|
3426e11858 | ||
|
|
ebefd7bccb | ||
|
|
5411b6342a | ||
|
|
a5cce9bf9f | ||
|
|
561f9e2075 | ||
|
|
fd402244d0 | ||
|
|
00f2601192 | ||
|
|
cf5f899a30 | ||
|
|
b7821147f5 | ||
|
|
0f6f11a751 | ||
|
|
5454f3aaca | ||
|
|
d41fb1f9ff | ||
|
|
dccf26c63e | ||
|
|
8886b529ee | ||
|
|
a874136a06 | ||
|
|
73b32e9eb3 | ||
|
|
e322cead28 | ||
|
|
6f7ce4eb35 | ||
|
|
d9fc1a3671 | ||
|
|
334021833c | ||
|
|
6b27526581 | ||
|
|
6f2692a991 | ||
|
|
862351c093 | ||
|
|
2b9a6b7c15 | ||
|
|
be484e6cb4 | ||
|
|
932d77f347 | ||
|
|
434fa5bb66 | ||
|
|
45d3fa9f89 | ||
|
|
702f623645 | ||
|
|
44b1ef7444 | ||
|
|
2e3dd8fe60 | ||
|
|
dc257a3a4f | ||
|
|
9e7ce49a73 | ||
|
|
c4b619a553 | ||
|
|
dd19a56732 | ||
|
|
09cc69fecb | ||
|
|
167e5cb271 | ||
|
|
ff633a565f | ||
|
|
154c08aac4 | ||
|
|
bad4a23450 | ||
|
|
80b3560659 | ||
|
|
a3e2a47c75 | ||
|
|
474fe34688 | ||
|
|
719c622d48 | ||
|
|
72d0d3c8b3 | ||
|
|
8f1bb3f9c3 | ||
|
|
e1b1954735 | ||
|
|
79b009fc57 | ||
|
|
c0e4e5bdd4 | ||
|
|
bb17c31beb | ||
|
|
2f00ce2a3e | ||
|
|
70528ac007 | ||
|
|
6bd4969ec6 | ||
|
|
e28ad717b8 | ||
|
|
f7896b6c4c | ||
|
|
553ff3fdfc | ||
|
|
8b1e9ddf26 | ||
|
|
db362d751e | ||
|
|
3280df5864 |
6
.eslintignore
Normal file
6
.eslintignore
Normal file
@@ -0,0 +1,6 @@
|
||||
# Ignore list
|
||||
/*
|
||||
|
||||
# Do not ignore these folders:
|
||||
!__tests__/
|
||||
!src/
|
||||
51
.eslintrc.js
Normal file
51
.eslintrc.js
Normal file
@@ -0,0 +1,51 @@
|
||||
// This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. Please don't make changes to this file as it's the subject of an automatic update.
|
||||
module.exports = {
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:eslint-plugin-jest/recommended',
|
||||
'eslint-config-prettier'
|
||||
],
|
||||
parser: '@typescript-eslint/parser',
|
||||
plugins: ['@typescript-eslint', 'eslint-plugin-node', 'eslint-plugin-jest'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-require-imports': 'error',
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-empty-function': 'off',
|
||||
'@typescript-eslint/ban-ts-comment': [
|
||||
'error',
|
||||
{
|
||||
'ts-ignore': 'allow-with-description'
|
||||
}
|
||||
],
|
||||
'no-console': 'error',
|
||||
'yoda': 'error',
|
||||
'prefer-const': [
|
||||
'error',
|
||||
{
|
||||
destructuring: 'all'
|
||||
}
|
||||
],
|
||||
'no-control-regex': 'off',
|
||||
'no-constant-condition': ['error', {checkLoops: false}],
|
||||
'node/no-extraneous-import': 'error'
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ['**/*{test,spec}.ts'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-unused-vars': 'off',
|
||||
'jest/no-standalone-expect': 'off',
|
||||
'jest/no-conditional-expect': 'off',
|
||||
'no-console': 'off',
|
||||
|
||||
}
|
||||
}
|
||||
],
|
||||
env: {
|
||||
node: true,
|
||||
es6: true,
|
||||
'jest/globals': true
|
||||
}
|
||||
};
|
||||
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
* text=auto eol=lf
|
||||
.licenses/** -diff linguist-generated=true
|
||||
1
.github/CODEOWNERS
vendored
Normal file
1
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1 @@
|
||||
* @actions/setup-actions-team
|
||||
32
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
32
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a bug report
|
||||
title: ''
|
||||
labels: bug, needs triage
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Description:**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**Task version:**
|
||||
Specify the task version
|
||||
|
||||
**Platform:**
|
||||
- [ ] Ubuntu
|
||||
- [ ] macOS
|
||||
- [ ] Windows
|
||||
|
||||
**Runner type:**
|
||||
- [ ] Hosted
|
||||
- [ ] Self-hosted
|
||||
|
||||
**Repro steps:**
|
||||
A description with steps to reproduce the issue. If your have a public example or repo to share, please provide the link.
|
||||
|
||||
**Expected behavior:**
|
||||
A description of what you expected to happen.
|
||||
|
||||
**Actual behavior:**
|
||||
A description of what is actually happening.
|
||||
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: .NET issues
|
||||
url: https://github.com/dotnet/runtime#filing-issues
|
||||
about: Issues with the runtime, class libraries, frameworks, and SDK should be addressed directly with the .NET team. Documentation on filing issues can be found here.
|
||||
16
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
16
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: feature request, needs triage
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
**Description:**
|
||||
Describe your proposal.
|
||||
|
||||
**Justification:**
|
||||
Justification or a use case for your proposal.
|
||||
|
||||
**Are you willing to submit a PR?**
|
||||
<!--- We accept contributions! -->
|
||||
9
.github/csc.json
vendored
9
.github/csc.json
vendored
@@ -4,14 +4,15 @@
|
||||
"owner": "csc",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^([^\\s].*)\\((\\d+|\\d+,\\d+|\\d+,\\d+,\\d+,\\d+)\\):\\s+(error|warning|info)\\s+(CS\\d+)\\s*:\\s*(.*)$",
|
||||
"regexp": "^([^\\s].*)\\((\\d+)(?:,\\d+|,\\d+,\\d+)?\\):\\s+(error|warning)\\s+([a-zA-Z]+(?<!MSB)\\d+):\\s*(.*?)\\s+\\[(.*?)\\]$",
|
||||
"file": 1,
|
||||
"location": 2,
|
||||
"line": 2,
|
||||
"severity": 3,
|
||||
"code": 4,
|
||||
"message": 5
|
||||
"message": 5,
|
||||
"fromPath": 6
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
22
.github/dependabot.yml
vendored
Normal file
22
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
# Enable version updates for npm
|
||||
- package-ecosystem: 'npm'
|
||||
# Look for `package.json` and `lock` files in the `root` directory
|
||||
directory: '/'
|
||||
# Check the npm registry for updates every day (weekdays)
|
||||
schedule:
|
||||
interval: 'weekly'
|
||||
|
||||
# Enable version updates for GitHub Actions
|
||||
- package-ecosystem: 'github-actions'
|
||||
# Workflow files stored in the default location of `.github/workflows`
|
||||
# You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.
|
||||
directory: '/'
|
||||
schedule:
|
||||
interval: 'weekly'
|
||||
9
.github/pull_request_template.md
vendored
Normal file
9
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
**Description:**
|
||||
Describe your changes.
|
||||
|
||||
**Related issue:**
|
||||
Add link to the related issue.
|
||||
|
||||
**Check list:**
|
||||
- [ ] Mark if documentation changes are required.
|
||||
- [ ] Mark if tests were added or updated to cover the changes.
|
||||
19
.github/workflows/basic-validation.yml
vendored
Normal file
19
.github/workflows/basic-validation.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Basic validation
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- releases/*
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
|
||||
jobs:
|
||||
call-basic-validation:
|
||||
name: Basic validation
|
||||
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main
|
||||
with:
|
||||
node-version: '24'
|
||||
19
.github/workflows/check-dist.yml
vendored
Normal file
19
.github/workflows/check-dist.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Check dist/
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
call-check-dist:
|
||||
name: Check dist/
|
||||
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main
|
||||
with:
|
||||
node-version: '24'
|
||||
14
.github/workflows/codeql-analysis.yml
vendored
Normal file
14
.github/workflows/codeql-analysis.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
name: CodeQL analysis
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
schedule:
|
||||
- cron: '0 3 * * 0'
|
||||
|
||||
jobs:
|
||||
call-codeQL-analysis:
|
||||
name: CodeQL analysis
|
||||
uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main
|
||||
625
.github/workflows/e2e-tests.yml
vendored
Normal file
625
.github/workflows/e2e-tests.yml
vendored
Normal file
@@ -0,0 +1,625 @@
|
||||
name: e2e tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- releases/*
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
|
||||
jobs:
|
||||
test-setup-multiple-versions:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system:
|
||||
[
|
||||
ubuntu-22.04,
|
||||
ubuntu-latest,
|
||||
windows-latest,
|
||||
macos-latest,
|
||||
macos-15-intel
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
- name: Setup dotnet 8.0.416, 8.0.x, 9.0.308 and 10.0.101
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: |
|
||||
8.0.416
|
||||
8.0.x
|
||||
9.0.308
|
||||
10.0.101
|
||||
- name: Verify dotnet
|
||||
shell: pwsh
|
||||
run: __tests__/verify-dotnet.ps1 -Patterns "^8.0.416$", "^9.0.308$", "^10.0.101$", "^8.0"
|
||||
test-setup-full-version:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system:
|
||||
[
|
||||
ubuntu-22.04,
|
||||
ubuntu-latest,
|
||||
windows-latest,
|
||||
macos-latest,
|
||||
macos-15-intel
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
# Side-by-side install of 9.0 and 10.0 used for the test project
|
||||
- name: Setup dotnet 9.0.308
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: 9.0.308
|
||||
- name: Setup dotnet 10.0.101
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: 10.0.101
|
||||
# We are including this variable to force the generation of the nuget config file to verify that it is created in the correct place
|
||||
source-url: https://api.nuget.org/v3/index.json
|
||||
env:
|
||||
NUGET_AUTH_TOKEN: NOTATOKEN
|
||||
- name: Verify dotnet
|
||||
shell: pwsh
|
||||
run: __tests__/verify-dotnet.ps1 -Patterns "^10.0.101$", "^9.0.308$" -CheckNugetConfig
|
||||
test-setup-without-patch-version:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system:
|
||||
[
|
||||
ubuntu-22.04,
|
||||
ubuntu-latest,
|
||||
windows-latest,
|
||||
macos-latest,
|
||||
macos-15-intel
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
# 9.0, 10.0 needs to be in single quotes to interpret as a string instead of as an integer
|
||||
- name: Setup dotnet '9.0'
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: '9.0'
|
||||
- name: Setup dotnet '10.0'
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: '10.0'
|
||||
- name: Verify dotnet
|
||||
shell: pwsh
|
||||
run: __tests__/verify-dotnet.ps1 -Patterns "^9.0", "^10.0"
|
||||
test-setup-prerelease-version:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system:
|
||||
[
|
||||
ubuntu-22.04,
|
||||
ubuntu-latest,
|
||||
windows-latest,
|
||||
macos-latest,
|
||||
macos-15-intel
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
- name: Setup dotnet '10.0.100-preview.7.25380.108'
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: '10.0.100-preview.7.25380.108'
|
||||
- name: Verify dotnet
|
||||
shell: pwsh
|
||||
run: __tests__/verify-dotnet.ps1 -Patterns "10.0.100-preview.7.25380.108"
|
||||
test-setup-latest-patch-version:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system:
|
||||
[
|
||||
ubuntu-22.04,
|
||||
ubuntu-latest,
|
||||
windows-latest,
|
||||
macos-latest,
|
||||
macos-15-intel
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
- name: Setup dotnet 9.0.x
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: 9.0.x
|
||||
- name: Setup dotnet 10.0.X
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: 10.0.X
|
||||
- name: Verify dotnet
|
||||
shell: pwsh
|
||||
run: __tests__/verify-dotnet.ps1 -Patterns "^9.0", "^10.0"
|
||||
|
||||
test-ABCxx-syntax:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system:
|
||||
[
|
||||
ubuntu-22.04,
|
||||
ubuntu-latest,
|
||||
windows-latest,
|
||||
macos-latest,
|
||||
macos-15-intel
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
|
||||
- name: Setup dotnet 10.0.1xx
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: '10.0.1xx'
|
||||
- name: Verify dotnet
|
||||
shell: pwsh
|
||||
run: __tests__/verify-dotnet.ps1 -Patterns "^10\.0\.1\d{2}"
|
||||
|
||||
test-setup-with-wildcard:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system:
|
||||
[
|
||||
ubuntu-22.04,
|
||||
ubuntu-latest,
|
||||
windows-latest,
|
||||
macos-latest,
|
||||
macos-15-intel
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
- name: Setup dotnet 9.0.*
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: 9.0.*
|
||||
- name: Setup dotnet 10.0.*
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: 10.0.*
|
||||
- name: Verify dotnet
|
||||
shell: pwsh
|
||||
run: __tests__/verify-dotnet.ps1 -Patterns "^9.0", "^10.0"
|
||||
|
||||
test-setup-global-json-specified-and-version:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system:
|
||||
[
|
||||
ubuntu-22.04,
|
||||
ubuntu-latest,
|
||||
windows-latest,
|
||||
macos-latest,
|
||||
macos-15-intel
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
- name: Write global.json
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir subdirectory
|
||||
echo '{"sdk":{"version": "9.0.308","rollForward": "latestFeature"}}' > ./subdirectory/global.json
|
||||
- name: Setup dotnet
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: '10.0'
|
||||
global-json-file: ./subdirectory/global.json
|
||||
- name: Verify dotnet
|
||||
shell: pwsh
|
||||
run: __tests__/verify-dotnet.ps1 -Patterns "^9.0", "^10.0"
|
||||
|
||||
test-setup-global-json-only:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system:
|
||||
[
|
||||
ubuntu-22.04,
|
||||
ubuntu-latest,
|
||||
windows-latest,
|
||||
macos-latest,
|
||||
macos-15-intel
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
- name: Write global.json
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir subdirectory
|
||||
echo '{"sdk":{"version": "10.0.101","rollForward": "latestFeature"}}' > ./subdirectory/global.json
|
||||
- name: Setup dotnet
|
||||
uses: ./
|
||||
with:
|
||||
global-json-file: ./subdirectory/global.json
|
||||
- name: Verify dotnet
|
||||
shell: pwsh
|
||||
run: __tests__/verify-dotnet.ps1 -Patterns "^10.0"
|
||||
|
||||
test-global-json-with-comments:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system:
|
||||
[
|
||||
ubuntu-22.04,
|
||||
ubuntu-latest,
|
||||
windows-latest,
|
||||
macos-latest,
|
||||
macos-15-intel
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
- name: Write global.json
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir subdirectory
|
||||
echo '/* should support comments */ {"sdk":{"version": "10.0.101","rollForward": "latestFeature"}} // should support comments' > ./subdirectory/global.json
|
||||
- name: Setup dotnet
|
||||
uses: ./
|
||||
with:
|
||||
global-json-file: ./subdirectory/global.json
|
||||
- name: Verify dotnet
|
||||
shell: pwsh
|
||||
run: __tests__/verify-dotnet.ps1 -Patterns "^10.0"
|
||||
|
||||
test-setup-with-dotnet-quality:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system:
|
||||
[
|
||||
ubuntu-22.04,
|
||||
ubuntu-latest,
|
||||
windows-latest,
|
||||
macos-latest,
|
||||
macos-15-intel
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
|
||||
- name: Setup dotnet 10.0 with preview quality
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: '10.0'
|
||||
dotnet-quality: 'preview'
|
||||
- name: Verify dotnet
|
||||
shell: pwsh
|
||||
run: __tests__/verify-dotnet.ps1 -Patterns "^10\.0\.\d+-"
|
||||
|
||||
test-setup-with-cache:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system:
|
||||
[
|
||||
ubuntu-22.04,
|
||||
ubuntu-latest,
|
||||
windows-latest,
|
||||
macos-latest,
|
||||
macos-15-intel
|
||||
]
|
||||
env:
|
||||
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
- name: Copy NuGet lock file to root
|
||||
shell: bash
|
||||
run: cp ./__tests__/e2e-test-csproj/packages.lock.json ./packages.lock.json
|
||||
- name: Setup .NET Core 10.0
|
||||
id: setup-dotnet
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: '10.0'
|
||||
cache: true
|
||||
- name: Verify Cache
|
||||
if: steps.setup-dotnet.outputs.cache-hit == 'true'
|
||||
shell: bash
|
||||
run: if [[ -e ${NUGET_PACKAGES} ]]; then exit 0; else exit 1; fi
|
||||
- name: Verify dotnet
|
||||
shell: pwsh
|
||||
run: __tests__/verify-dotnet.ps1 -Patterns "^10.0"
|
||||
|
||||
test-setup-with-cache-dependency-path:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system:
|
||||
[
|
||||
ubuntu-22.04,
|
||||
ubuntu-latest,
|
||||
windows-latest,
|
||||
macos-latest,
|
||||
macos-15-intel
|
||||
]
|
||||
env:
|
||||
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
- name: Setup .NET Core 10.0
|
||||
id: setup-dotnet
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: '10.0'
|
||||
cache: true
|
||||
cache-dependency-path: './__tests__/e2e-test-csproj/packages.lock.json'
|
||||
- name: Verify Cache
|
||||
if: steps.setup-dotnet.outputs.cache-hit == 'true'
|
||||
shell: bash
|
||||
run: if [[ -e ${NUGET_PACKAGES} ]]; then exit 0; else exit 1; fi
|
||||
- name: Verify dotnet
|
||||
shell: pwsh
|
||||
run: __tests__/verify-dotnet.ps1 -Patterns "^10.0"
|
||||
|
||||
test-dotnet-version-output-during-single-version-installation:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system:
|
||||
[
|
||||
ubuntu-22.04,
|
||||
ubuntu-latest,
|
||||
windows-latest,
|
||||
macos-latest,
|
||||
macos-15-intel
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
|
||||
- name: Setup dotnet 10.0.101
|
||||
uses: ./
|
||||
id: step1
|
||||
with:
|
||||
dotnet-version: '10.0.101'
|
||||
|
||||
- name: Verify value of the dotnet-version output
|
||||
shell: pwsh
|
||||
run: |
|
||||
$version = & dotnet --version
|
||||
Write-Host "Installed version: $version"
|
||||
if (-not ($version -eq '${{steps.step1.outputs.dotnet-version}}')) { throw "Unexpected output value" }
|
||||
|
||||
test-dotnet-version-output-during-multiple-version-installation:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system:
|
||||
[
|
||||
ubuntu-22.04,
|
||||
ubuntu-latest,
|
||||
windows-latest,
|
||||
macos-latest,
|
||||
macos-15-intel
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
|
||||
- name: Setup dotnet 8.0.402, 9.0.308, 10.0.101
|
||||
uses: ./
|
||||
id: step2
|
||||
with:
|
||||
dotnet-version: |
|
||||
10.0.101
|
||||
9.0.308
|
||||
8.0.402
|
||||
|
||||
- name: Verify value of the dotnet-version output
|
||||
shell: pwsh
|
||||
run: |
|
||||
$version = "10.0.101"
|
||||
if (-not ($version -eq '${{steps.step2.outputs.dotnet-version}}')) { throw "Unexpected output value" }
|
||||
|
||||
test-proxy:
|
||||
runs-on: ubuntu-22.04
|
||||
container:
|
||||
image: ubuntu:22.04
|
||||
options: --dns 127.0.0.1
|
||||
services:
|
||||
squid-proxy:
|
||||
image: ubuntu/squid:latest
|
||||
ports:
|
||||
- 3128:3128
|
||||
env:
|
||||
https_proxy: http://squid-proxy:3128
|
||||
http_proxy: http://squid-proxy:3128
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Install Powershell
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y wget apt-transport-https software-properties-common
|
||||
wget -q "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb"
|
||||
dpkg -i packages-microsoft-prod.deb
|
||||
rm packages-microsoft-prod.deb
|
||||
apt-get update
|
||||
apt-get install -y powershell
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
- name: Setup dotnet 10.0
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: 10.0
|
||||
source-url: https://api.nuget.org/v3/index.json
|
||||
env:
|
||||
NUGET_AUTH_TOKEN: NOTATOKEN
|
||||
- name: Verify dotnet
|
||||
shell: pwsh
|
||||
run: |
|
||||
__tests__/verify-dotnet.ps1 -Patterns "^10.0" -CheckNugetConfig
|
||||
|
||||
test-bypass-proxy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
https_proxy: http://no-such-proxy:3128
|
||||
no_proxy: github.com,download.visualstudio.microsoft.com,api.nuget.org,builds.dotnet.microsoft.com,ci.dot.net
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
- name: Setup dotnet 10.0.101
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: 10.0.101
|
||||
source-url: https://api.nuget.org/v3/index.json
|
||||
env:
|
||||
NUGET_AUTH_TOKEN: NOTATOKEN
|
||||
- name: Verify dotnet
|
||||
shell: pwsh
|
||||
run: __tests__/verify-dotnet.ps1 -Patterns "^10.0.101$" -CheckNugetConfig
|
||||
|
||||
test-sequential-version-installation:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system:
|
||||
[
|
||||
ubuntu-22.04,
|
||||
ubuntu-latest,
|
||||
windows-latest,
|
||||
macos-latest,
|
||||
macos-15-intel
|
||||
]
|
||||
lower-version: ['9.0.308']
|
||||
higher-version: ['10.0.101']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
# Install one version, use it for something, then switch to next version
|
||||
- name: Setup dotnet (lower version)
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: ${{ matrix.lower-version }}
|
||||
- name: Verify dotnet (lower version)
|
||||
shell: pwsh
|
||||
run: __tests__/verify-dotnet.ps1 -Patterns "^${{ matrix.lower-version }}$"
|
||||
- name: Setup dotnet (higher version)
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: ${{ matrix.higher-version }}
|
||||
- name: Verify dotnet (higher version)
|
||||
shell: pwsh
|
||||
run: __tests__/verify-dotnet.ps1 -Patterns "^${{ matrix.lower-version }}$", "^${{ matrix.higher-version }}$"
|
||||
|
||||
test-setup-with-workloads-input:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system:
|
||||
[ubuntu-latest, windows-latest, macos-15-intel, macos-latest]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
|
||||
- name: Setup dotnet 9.0 with workloads
|
||||
uses: ./
|
||||
id: setup-dotnet
|
||||
with:
|
||||
dotnet-version: '9.0'
|
||||
workloads: wasm-tools
|
||||
- name: Verify workload
|
||||
shell: pwsh
|
||||
run: |
|
||||
$output = dotnet workload list | Out-String
|
||||
Write-Host "Workload list output:"
|
||||
Write-Host $output
|
||||
if ($output -notmatch "wasm-tools") {
|
||||
throw "Expected workload 'wasm-tools' not found"
|
||||
}
|
||||
- name: Verify dotnet
|
||||
shell: pwsh
|
||||
run: __tests__/verify-dotnet.ps1 -Patterns "^9\.0"
|
||||
15
.github/workflows/licensed.yml
vendored
Normal file
15
.github/workflows/licensed.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
name: Licensed
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
call-licensed:
|
||||
name: Licensed
|
||||
uses: actions/reusable-workflows/.github/workflows/licensed.yml@main
|
||||
20
.github/workflows/publish-immutable-actions.yml
vendored
Normal file
20
.github/workflows/publish-immutable-actions.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
name: 'Publish Immutable Action Version'
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checking out
|
||||
uses: actions/checkout@v6
|
||||
- name: Publish
|
||||
id: publish
|
||||
uses: actions/publish-immutable-action@v0.0.4
|
||||
29
.github/workflows/release-new-action-version.yml
vendored
Normal file
29
.github/workflows/release-new-action-version.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: Release new action version
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [released]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
TAG_NAME:
|
||||
description: 'Tag name that the major tag will point to'
|
||||
required: true
|
||||
|
||||
env:
|
||||
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
update_tag:
|
||||
name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes
|
||||
environment:
|
||||
name: releaseNewActionVersion
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Update the ${{ env.TAG_NAME }} tag
|
||||
id: update-major-tag
|
||||
uses: actions/publish-action@v0.4.0
|
||||
with:
|
||||
source-tag: ${{ env.TAG_NAME }}
|
||||
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
||||
42
.github/workflows/test-dotnet.yml
vendored
Normal file
42
.github/workflows/test-dotnet.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
name: Validate dotnet
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- releases/*
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
|
||||
jobs:
|
||||
setup-version:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system:
|
||||
[
|
||||
ubuntu-latest,
|
||||
ubuntu-22.04,
|
||||
windows-latest,
|
||||
macos-15-intel,
|
||||
macos-latest
|
||||
]
|
||||
dotnet-version: ['8.0', '9.0', '10.0']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Clear toolcache
|
||||
shell: pwsh
|
||||
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||
- name: Setup dotnet ${{ matrix.dotnet-version }}
|
||||
uses: ./
|
||||
with:
|
||||
dotnet-version: ${{ matrix.dotnet-version }}
|
||||
- name: Verify installed version
|
||||
shell: pwsh
|
||||
run: |
|
||||
__tests__/verify-dotnet.ps1 -Patterns "^${{ matrix.dotnet-version }}"
|
||||
11
.github/workflows/update-config-files.yml
vendored
Normal file
11
.github/workflows/update-config-files.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
name: Update configuration files
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 3 * * 0'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
call-update-configuration-files:
|
||||
name: Update configuration files
|
||||
uses: actions/reusable-workflows/.github/workflows/update-config-files.yml@main
|
||||
26
.github/workflows/workflow.yml
vendored
26
.github/workflows/workflow.yml
vendored
@@ -1,26 +0,0 @@
|
||||
name: Main workflow
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
run:
|
||||
name: Run
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest, windows-latest]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Set Node.js 10.x
|
||||
uses: actions/setup-node@master
|
||||
with:
|
||||
version: 10.x
|
||||
|
||||
- name: npm install
|
||||
run: npm install
|
||||
|
||||
- name: Lint
|
||||
run: npm run format-check
|
||||
|
||||
- name: npm test
|
||||
run: npm test
|
||||
11
.gitignore
vendored
11
.gitignore
vendored
@@ -1,6 +1,10 @@
|
||||
# Explicitly not ignoring node_modules so that they are included in package downloaded by runner
|
||||
!node_modules/
|
||||
# dev dependencies are *not* checked in
|
||||
global.json
|
||||
lib/
|
||||
node_modules/
|
||||
__tests__/runner/*
|
||||
__tests__/e2e-test-csproj/bin/
|
||||
__tests__/e2e-test-csproj/obj/
|
||||
|
||||
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
|
||||
# Logs
|
||||
@@ -90,3 +94,6 @@ typings/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
|
||||
# Ignore .vscode files
|
||||
.vscode/
|
||||
5
.husky/pre-commit
Executable file
5
.husky/pre-commit
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
npm run format
|
||||
npm run lint:fix
|
||||
6
.husky/pre-push
Executable file
6
.husky/pre-push
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
# Tests are not run at push time since they can take 2-4 minutes to complete
|
||||
npm run format-check
|
||||
npm run lint
|
||||
16
.licensed.yml
Normal file
16
.licensed.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
sources:
|
||||
npm: true
|
||||
|
||||
allowed:
|
||||
- apache-2.0
|
||||
- 0bsd
|
||||
- bsd-2-clause
|
||||
- bsd-3-clause
|
||||
- isc
|
||||
- mit
|
||||
- cc0-1.0
|
||||
- unlicense
|
||||
|
||||
reviewed:
|
||||
npm:
|
||||
- sax # ISC + MIT
|
||||
BIN
.licenses/npm/@actions/cache.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/cache.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@actions/core-1.11.1.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/core-1.11.1.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@actions/core-2.0.1.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/core-2.0.1.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@actions/exec-1.1.1.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/exec-1.1.1.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@actions/exec-2.0.0.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/exec-2.0.0.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@actions/github.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/github.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@actions/glob.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/glob.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@actions/http-client-2.2.3.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/http-client-2.2.3.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@actions/http-client-3.0.0.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/http-client-3.0.0.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@actions/io-1.1.3.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/io-1.1.3.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@actions/io-2.0.0.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/io-2.0.0.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/abort-controller-1.1.0.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/abort-controller-1.1.0.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/abort-controller-2.1.2.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/abort-controller-2.1.2.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/core-auth.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/core-auth.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/core-client.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/core-client.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/core-http-compat.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/core-http-compat.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/core-lro.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/core-lro.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/core-paging.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/core-paging.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/core-rest-pipeline.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/core-rest-pipeline.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/core-tracing.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/core-tracing.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/core-util.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/core-util.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/core-xml.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/core-xml.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/logger.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/logger.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/storage-blob.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/storage-blob.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/storage-common.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/storage-common.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@fastify/busboy.dep.yml
generated
Normal file
BIN
.licenses/npm/@fastify/busboy.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@octokit/auth-token.dep.yml
generated
Normal file
BIN
.licenses/npm/@octokit/auth-token.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@octokit/core.dep.yml
generated
Normal file
BIN
.licenses/npm/@octokit/core.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@octokit/endpoint.dep.yml
generated
Normal file
BIN
.licenses/npm/@octokit/endpoint.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@octokit/graphql.dep.yml
generated
Normal file
BIN
.licenses/npm/@octokit/graphql.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@octokit/openapi-types-19.0.2.dep.yml
generated
Normal file
BIN
.licenses/npm/@octokit/openapi-types-19.0.2.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@octokit/openapi-types-20.0.0.dep.yml
generated
Normal file
BIN
.licenses/npm/@octokit/openapi-types-20.0.0.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@octokit/openapi-types-24.2.0.dep.yml
generated
Normal file
BIN
.licenses/npm/@octokit/openapi-types-24.2.0.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@octokit/plugin-paginate-rest.dep.yml
generated
Normal file
BIN
.licenses/npm/@octokit/plugin-paginate-rest.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@octokit/plugin-rest-endpoint-methods.dep.yml
generated
Normal file
BIN
.licenses/npm/@octokit/plugin-rest-endpoint-methods.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@octokit/request-error.dep.yml
generated
Normal file
BIN
.licenses/npm/@octokit/request-error.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@octokit/request.dep.yml
generated
Normal file
BIN
.licenses/npm/@octokit/request.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@octokit/types-12.3.0.dep.yml
generated
Normal file
BIN
.licenses/npm/@octokit/types-12.3.0.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@octokit/types-12.6.0.dep.yml
generated
Normal file
BIN
.licenses/npm/@octokit/types-12.6.0.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@octokit/types-13.10.0.dep.yml
generated
Normal file
BIN
.licenses/npm/@octokit/types-13.10.0.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/runtime-rpc.dep.yml
generated
Normal file
BIN
.licenses/npm/@protobuf-ts/runtime-rpc.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/runtime.dep.yml
generated
Normal file
BIN
.licenses/npm/@protobuf-ts/runtime.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@typespec/ts-http-runtime.dep.yml
generated
Normal file
BIN
.licenses/npm/@typespec/ts-http-runtime.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/agent-base.dep.yml
generated
Normal file
BIN
.licenses/npm/agent-base.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/balanced-match.dep.yml
generated
Normal file
BIN
.licenses/npm/balanced-match.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/before-after-hook.dep.yml
generated
Normal file
BIN
.licenses/npm/before-after-hook.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/brace-expansion.dep.yml
generated
Normal file
BIN
.licenses/npm/brace-expansion.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/concat-map.dep.yml
generated
Normal file
BIN
.licenses/npm/concat-map.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/debug.dep.yml
generated
Normal file
BIN
.licenses/npm/debug.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/deprecation.dep.yml
generated
Normal file
BIN
.licenses/npm/deprecation.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/events.dep.yml
generated
Normal file
BIN
.licenses/npm/events.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/fast-xml-parser.dep.yml
generated
Normal file
BIN
.licenses/npm/fast-xml-parser.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/http-proxy-agent.dep.yml
generated
Normal file
BIN
.licenses/npm/http-proxy-agent.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/https-proxy-agent.dep.yml
generated
Normal file
BIN
.licenses/npm/https-proxy-agent.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/json5.dep.yml
generated
Normal file
BIN
.licenses/npm/json5.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/lru-cache.dep.yml
generated
Normal file
BIN
.licenses/npm/lru-cache.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/minimatch.dep.yml
generated
Normal file
BIN
.licenses/npm/minimatch.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/ms.dep.yml
generated
Normal file
BIN
.licenses/npm/ms.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/once.dep.yml
generated
Normal file
BIN
.licenses/npm/once.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/semver-6.3.1.dep.yml
generated
Normal file
BIN
.licenses/npm/semver-6.3.1.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/semver-7.6.0.dep.yml
generated
Normal file
BIN
.licenses/npm/semver-7.6.0.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/strnum.dep.yml
generated
Normal file
BIN
.licenses/npm/strnum.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/tslib.dep.yml
generated
Normal file
BIN
.licenses/npm/tslib.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/tunnel.dep.yml
generated
Normal file
BIN
.licenses/npm/tunnel.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/undici.dep.yml
generated
Normal file
BIN
.licenses/npm/undici.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/universal-user-agent.dep.yml
generated
Normal file
BIN
.licenses/npm/universal-user-agent.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/wrappy.dep.yml
generated
Normal file
BIN
.licenses/npm/wrappy.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/yallist.dep.yml
generated
Normal file
BIN
.licenses/npm/yallist.dep.yml
generated
Normal file
Binary file not shown.
7
.prettierignore
Normal file
7
.prettierignore
Normal file
@@ -0,0 +1,7 @@
|
||||
# Ignore list
|
||||
/*
|
||||
|
||||
# Do not ignore these folders:
|
||||
!__tests__/
|
||||
!.github/
|
||||
!src/
|
||||
11
.prettierrc.js
Normal file
11
.prettierrc.js
Normal file
@@ -0,0 +1,11 @@
|
||||
// This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. Please don't make changes to this file as it's the subject of an automatic update.
|
||||
module.exports = {
|
||||
printWidth: 80,
|
||||
tabWidth: 2,
|
||||
useTabs: false,
|
||||
semi: true,
|
||||
singleQuote: true,
|
||||
trailingComma: 'none',
|
||||
bracketSpacing: false,
|
||||
arrowParens: 'avoid'
|
||||
};
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"printWidth": 80,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"semi": true,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"bracketSpacing": false,
|
||||
"arrowParens": "avoid",
|
||||
"parser": "typescript"
|
||||
}
|
||||
76
CODE_OF_CONDUCT.md
Normal file
76
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to make participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all project spaces, and it also applies when
|
||||
an individual is representing the project or its community in public spaces.
|
||||
Examples of representing a project or community include using an official
|
||||
project e-mail address, posting via an official social media account, or acting
|
||||
as an appointed representative at an online or offline event. Representation of
|
||||
a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at opensource+actions/setup-dotnet@github.com. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see
|
||||
https://www.contributor-covenant.org/faq
|
||||
365
README.md
365
README.md
@@ -1,50 +1,357 @@
|
||||
# setup-dotnet
|
||||
|
||||
<p align="left">
|
||||
<a href="https://github.com/actions/setup-dotnet"><img alt="GitHub Actions status" src="https://github.com/actions/setup-dotnet/workflows/Main%20workflow/badge.svg"></a>
|
||||
</p>
|
||||
[](https://github.com/actions/setup-dotnet/actions/workflows/basic-validation.yml)
|
||||
[](https://github.com/actions/setup-dotnet/actions/workflows/e2e-tests.yml)
|
||||
|
||||
This action sets up a dotnet environment for use in actions by:
|
||||
This action sets up a [.NET CLI](https://github.com/dotnet/sdk) environment for use in actions by:
|
||||
|
||||
- optionally downloading and caching a version of dotnet by SDK version and adding to PATH
|
||||
- optionally downloading and caching a version(s) of dotnet by SDK version(s) and adding to PATH
|
||||
- registering problem matchers for error output
|
||||
- setting up authentication to private package sources like GitHub Packages
|
||||
|
||||
# Usage
|
||||
> **Note**: GitHub hosted runners have some versions of the .NET SDK
|
||||
preinstalled. Installed versions are subject to change. Please refer to the
|
||||
documentation:
|
||||
[Software installed on github hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-software)
|
||||
for .NET SDK versions that are currently available.
|
||||
|
||||
## Breaking changes in V5
|
||||
|
||||
- Upgraded action from node20 to node24
|
||||
> Make sure your runner is on version v2.327.1 or later to ensure compatibility with this release. see [Release Notes](https://github.com/actions/runner/releases/tag/v2.327.1)
|
||||
|
||||
For more details, see the full release notes on the [release page](https://github.com/actions/setup-dotnet/releases/tag/v5.0.0)
|
||||
|
||||
## Usage
|
||||
|
||||
See [action.yml](action.yml)
|
||||
|
||||
Basic:
|
||||
**Basic**:
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions/setup-dotnet@v1
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: '2.2.103' # SDK Version to use.
|
||||
dotnet-version: '8.0.x'
|
||||
- run: dotnet build <my project>
|
||||
```
|
||||
> **Warning**: Unless a concrete version is specified in the [`global.json`](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json) file, **_the latest .NET version installed on the runner (including preinstalled versions) will be used [by default](https://learn.microsoft.com/en-us/dotnet/core/versions/selection#the-sdk-uses-the-latest-installed-version)_**. Please refer to the [documentation](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-software) for the currently preinstalled .NET SDK versions.
|
||||
|
||||
**Multiple version installation**:
|
||||
```yml
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: |
|
||||
8.0.x
|
||||
9.0.x
|
||||
- run: dotnet build <my project>
|
||||
```
|
||||
## Supported version syntax
|
||||
|
||||
The `dotnet-version` input supports following syntax:
|
||||
|
||||
- **A.B.C** (e.g 9.0.308, 10.0.100-preview.1.25120.13) - installs exact version of .NET SDK
|
||||
- **A.B** or **A.B.x** (e.g. 8.0, 8.0.x) - installs the latest patch version of .NET SDK on the channel `8.0`, including prerelease versions (preview, rc)
|
||||
- **A** or **A.x** (e.g. 8, 8.x) - installs the latest minor version of the specified major tag, including prerelease versions (preview, rc)
|
||||
- **A.B.Cxx** (e.g. 8.0.4xx) - available since `.NET 5.0` release. Installs the latest version of the specific SDK release, including prerelease versions (preview, rc).
|
||||
|
||||
|
||||
## Using the `dotnet-quality` input
|
||||
This input sets up the action to install the latest build of the specified quality in the channel. The possible values of `dotnet-quality` are: **daily**, **signed**, **validated**, **preview**, **ga**.
|
||||
|
||||
> **Note**: `dotnet-quality` input can be used only with .NET SDK version in 'A.B', 'A.B.x', 'A', 'A.x' and 'A.B.Cxx' formats where the major version is higher than 5. In other cases, `dotnet-quality` input will be ignored.
|
||||
|
||||
```yml
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
dotnet-quality: 'preview'
|
||||
- run: dotnet build <my project>
|
||||
```
|
||||
|
||||
Matrix Testing:
|
||||
```yaml
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-16.04
|
||||
strategy:
|
||||
matrix:
|
||||
dotnet: [ '2.2.103', '3.0.100-preview8-013656', '4.5.1' ]
|
||||
name: Dotnet ${{ matrix.dotnet }} sample
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: ${{ matrix.dotnet }}
|
||||
- run: dotnet build <my project>
|
||||
## Using the `global-json-file` input
|
||||
`setup-dotnet` action can read .NET SDK version from a `global.json` file. Input `global-json-file` is used for specifying the path to the `global.json`. If the file that was supplied to `global-json-file` input doesn't exist, the action will fail with error.
|
||||
|
||||
>**Note**: In case both `dotnet-version` and `global-json-file` inputs are used, versions from both inputs will be installed.
|
||||
|
||||
```yml
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
global-json-file: csharp/global.json
|
||||
- run: dotnet build <my project>
|
||||
working-directory: csharp
|
||||
```
|
||||
|
||||
# License
|
||||
## Caching NuGet Packages
|
||||
The action has a built-in functionality for caching and restoring dependencies. It uses [toolkit/cache](https://github.com/actions/toolkit/tree/main/packages/cache) under the hood for caching global packages data but requires less configuration settings. The `cache` input is optional, and caching is turned off by default.
|
||||
|
||||
The action searches for [NuGet Lock files](https://learn.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies) (`packages.lock.json`) in the repository root, calculates their hash and uses it as a part of the cache key. If lock file does not exist, this action throws error. Use `cache-dependency-path` for cases when multiple dependency files are used, or they are located in different subdirectories.
|
||||
|
||||
> **Warning**: Caching NuGet packages is available since .NET SDK 2.1.500 and 2.2.100 as the NuGet lock file [is available](https://learn.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies) only for NuGet 4.9 and above.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.x
|
||||
cache: true
|
||||
- run: dotnet restore --locked-mode
|
||||
```
|
||||
|
||||
> **Note**: This action will only restore `global-packages` folder, so you will probably get the [NU1403](https://learn.microsoft.com/nuget/reference/errors-and-warnings/nu1403) error when running `dotnet restore`.
|
||||
> To avoid this, you can use [`DisableImplicitNuGetFallbackFolder`](https://github.com/dotnet/reproducible-builds/blob/abfe986832aa28597d3340b92469d1a702013d23/Documentation/Reproducible-MSBuild/Techniques/DisableImplicitNuGetFallbackFolder.md) option.
|
||||
|
||||
```xml
|
||||
<PropertyGroup>
|
||||
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
|
||||
</PropertyGroup>
|
||||
```
|
||||
|
||||
### Reduce caching size
|
||||
|
||||
> **Note**: Use [`NUGET_PACKAGES`](https://learn.microsoft.com/nuget/reference/cli-reference/cli-ref-environment-variables) environment variable if available. Some action runners already has huge libraries. (ex. Xamarin)
|
||||
|
||||
```yaml
|
||||
env:
|
||||
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.x
|
||||
cache: true
|
||||
- run: dotnet restore --locked-mode
|
||||
```
|
||||
|
||||
### Caching NuGet packages in monorepos
|
||||
|
||||
```yaml
|
||||
env:
|
||||
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.x
|
||||
cache: true
|
||||
cache-dependency-path: subdir/packages.lock.json
|
||||
- run: dotnet restore --locked-mode
|
||||
```
|
||||
|
||||
## Matrix Testing
|
||||
Using `setup-dotnet` it's possible to use [matrix syntax](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix) to install several versions of .NET SDK:
|
||||
```yml
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
dotnet: [ '8.0.x', '9.0.x', '10.0.x' ]
|
||||
name: Dotnet ${{ matrix.dotnet }} sample
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: ${{ matrix.dotnet }}
|
||||
- name: Execute dotnet
|
||||
run: dotnet build <my project>
|
||||
```
|
||||
>**Note**: Unless a concrete version is specified in the [`global.json`](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json) file, the latest .NET version installed on the runner (including preinstalled versions) will be used [by default](https://learn.microsoft.com/en-us/dotnet/core/versions/selection#the-sdk-uses-the-latest-installed-version). To control this behavior you may want to use temporary `global.json` files:
|
||||
|
||||
**Matrix testing with temporary global.json creation**
|
||||
```yml
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
dotnet: [ '8.0.x', '9.0.x', '10.0.x' ]
|
||||
name: Dotnet ${{ matrix.dotnet }} sample
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v5
|
||||
id: stepid
|
||||
with:
|
||||
dotnet-version: ${{ matrix.dotnet }}
|
||||
- name: Create temporary global.json
|
||||
run: echo '{"sdk":{"version": "${{ steps.stepid.outputs.dotnet-version }}"}}' > ./global.json
|
||||
- name: Execute dotnet
|
||||
run: dotnet build <my project>
|
||||
```
|
||||
>**Note**: When generating a temporary `global.json` within your workflow on Windows, ensure the command is executed using a shell such as PowerShell Core (`pwsh`) or `bash` (where supported) to avoid formatting inconsistencies that could cause .NET commands to fail.
|
||||
## Setting up authentication for nuget feeds
|
||||
|
||||
### Github Package Registry (GPR)
|
||||
```yml
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
source-url: https://nuget.pkg.github.com/<owner>/index.json
|
||||
env:
|
||||
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
- run: dotnet build <my project>
|
||||
- name: Create the package
|
||||
run: dotnet pack --configuration Release <my project>
|
||||
- name: Publish the package to GPR
|
||||
run: dotnet nuget push <my project>/bin/Release/*.nupkg
|
||||
```
|
||||
|
||||
### Azure Artifacts
|
||||
```yml
|
||||
- uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
source-url: https://pkgs.dev.azure.com/<your-organization>/_packaging/<your-feed-name>/nuget/v3/index.json
|
||||
env:
|
||||
NUGET_AUTH_TOKEN: ${{secrets.AZURE_DEVOPS_PAT}} # Note, create a secret with this name in Settings
|
||||
- name: Publish the package to Azure Artifacts
|
||||
run: dotnet nuget push <my project>/bin/Release/*.nupkg
|
||||
```
|
||||
|
||||
### nuget.org
|
||||
```yml
|
||||
- uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
- name: Publish the package to nuget.org
|
||||
run: dotnet nuget push */bin/Release/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json
|
||||
env:
|
||||
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }}
|
||||
```
|
||||
> **Note**: It's the only way to push a package to nuget.org feed for macOS/Linux machines due to API key config store limitations.
|
||||
|
||||
## Using the `workloads` input
|
||||
The `workloads` input allows you to install .NET workloads as part of the SDK setup. Workloads provide additional platform tools and dependencies for frameworks. This action automatically runs `dotnet workload update` before installing the specified workloads to ensure manifests are refreshed and existing workloads are updated to their latest compatible versions.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Setup .NET with workloads
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: '9.0.x'
|
||||
workloads: workload1, workload2 # Specify the workloads required for the project, such as wasm-tools, maui, etc.
|
||||
- run: dotnet build <my project>
|
||||
```
|
||||
|
||||
> **Note**: Ensure workloads are compatible with your runner's OS, architecture, and .NET SDK version before enabling workload installation. Some workloads may require additional installation time due to large toolchain downloads.
|
||||
|
||||
# Outputs and environment variables
|
||||
|
||||
## Outputs
|
||||
|
||||
### `dotnet-version`
|
||||
|
||||
Using the **dotnet-version** output it's possible to get the installed by the action .NET SDK version.
|
||||
|
||||
**Single version installation**
|
||||
|
||||
In case of a single version installation, the `dotnet-version` output contains the version that is installed by the action.
|
||||
|
||||
```yaml
|
||||
- uses: actions/setup-dotnet@v5
|
||||
id: stepid
|
||||
with:
|
||||
dotnet-version: 8.0.416
|
||||
- run: echo '${{ steps.stepid.outputs.dotnet-version }}' # outputs 8.0.416
|
||||
```
|
||||
|
||||
**Multiple version installation**
|
||||
|
||||
In case of a multiple version installation, the `dotnet-version` output contains the latest version that is installed by the action.
|
||||
|
||||
```yaml
|
||||
- uses: actions/setup-dotnet@v5
|
||||
id: stepid
|
||||
with:
|
||||
dotnet-version: |
|
||||
8.0.416
|
||||
9.0.308
|
||||
- run: echo '${{ steps.stepid.outputs.dotnet-version }}' # outputs 9.0.308
|
||||
```
|
||||
**Installation from global.json**
|
||||
|
||||
When the `dotnet-version` input is used along with the `global-json-file` input, the `dotnet-version` output contains the version resolved from the `global.json`.
|
||||
|
||||
```yaml
|
||||
- uses: actions/setup-dotnet@v5
|
||||
id: stepid
|
||||
with:
|
||||
dotnet-version: |
|
||||
9.0.308
|
||||
10.0.101
|
||||
global-json-file: "./global.json" # contains version 8.0.416
|
||||
- run: echo '${{ steps.stepid.outputs.dotnet-version }}' # outputs 8.0.416
|
||||
```
|
||||
|
||||
### `cache-hit`
|
||||
A boolean value to indicate an exact match was found for the cache key (follows [actions/cache](https://github.com/actions/cache#outputs))
|
||||
|
||||
## Environment variables
|
||||
|
||||
Some environment variables may be necessary for your particular case or to improve logging. Some examples are listed below, but the full list with complete details can be found here: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-environment-variables
|
||||
|
||||
| **Env.variable** | **Description** | **Default value** |
|
||||
| ----------- | ----------- | ----------- |
|
||||
| DOTNET_INSTALL_DIR |Specifies a directory where .NET SDKs should be installed by the action.|*default value for each OS* |
|
||||
| DOTNET_NOLOGO |Removes logo and telemetry message from first run of dotnet cli|*false*|
|
||||
| DOTNET_CLI_TELEMETRY_OPTOUT |Opt-out of telemetry being sent to Microsoft|*false*|
|
||||
| DOTNET_MULTILEVEL_LOOKUP |Configures whether the global install location is used as a fall-back|*true*|
|
||||
| NUGET_PACKAGES |Configures a path to the [NuGet `global-packages` folder](https://learn.microsoft.com/nuget/consume-packages/managing-the-global-packages-and-cache-folders)|*default value for each OS* |
|
||||
|
||||
The default values of the `DOTNET_INSTALL_DIR` and `NUGET_PACKAGES` environment variables depend on the operation system which is used on a runner:
|
||||
| **Operation system** | `DOTNET_INSTALL_DIR` | `NUGET_PACKAGES` |
|
||||
| ----------- | ----------- | ----------- |
|
||||
| **Windows** | `C:\Program Files\dotnet` | `%userprofile%\.nuget\packages` |
|
||||
| **Ubuntu** | `/usr/share/dotnet` | `~/.nuget/packages` |
|
||||
| **macOS** | `/Users/runner/.dotnet` | `~/.nuget/packages` |
|
||||
|
||||
**Example usage of environment variable**:
|
||||
```yml
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOTNET_INSTALL_DIR: "path/to/directory"
|
||||
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
cache: true
|
||||
```
|
||||
You can also set `DOTNET_INSTALL_DIR` to a value based on runtime variables, such as `$HOME/.dotnet` or `${{ runner.temp }}/.dotnet` before the `setup-dotnet` step:
|
||||
|
||||
```yml
|
||||
- name: Set DOTNET_INSTALL_DIR
|
||||
run: echo "DOTNET_INSTALL_DIR=$HOME/.dotnet" >> $GITHUB_ENV
|
||||
```
|
||||
> **Note**: On some self-hosted or large Linux runners, installing .NET under the default `/usr/share/dotnet` location may fail due to insufficient permissions. To ensure successful installation, set `DOTNET_INSTALL_DIR` to a user-writable path.
|
||||
|
||||
## Recommended permissions
|
||||
|
||||
When using the `setup-dotnet` action in your GitHub Actions workflow, it is recommended to set the following permissions to ensure proper functionality:
|
||||
|
||||
```yaml
|
||||
permissions:
|
||||
contents: read # access to check out code and install dependencies
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
The scripts and documentation in this project are released under the [MIT License](LICENSE)
|
||||
|
||||
# Contributions
|
||||
## Contributions
|
||||
|
||||
Contributions are welcome! See [Contributor's Guide](docs/contributors.md)
|
||||
Contributions are welcome! See [Contributor's Guide](docs/contributors.md)
|
||||
|
||||
185
__tests__/__snapshots__/authutil.test.ts.snap
Normal file
185
__tests__/__snapshots__/authutil.test.ts.snap
Normal file
@@ -0,0 +1,185 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`authutil tests existing config not in repo root, sets up a partial NuGet.config user/PAT for GPR 1`] = `
|
||||
"<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<config>
|
||||
<add key="defaultPushSource" value="https://nuget.pkg.github.com/OwnerName/index.json"/>
|
||||
</config>
|
||||
<packageSourceCredentials>
|
||||
<GPR>
|
||||
<add key="Username" value="OwnerName"/>
|
||||
<add key="ClearTextPassword" value="TEST_FAKE_AUTH_TOKEN"/>
|
||||
</GPR>
|
||||
</packageSourceCredentials>
|
||||
</configuration>"
|
||||
`;
|
||||
|
||||
exports[`authutil tests existing config w/ Azure Artifacts source and NuGet.org, sets up a partial NuGet.config user/PAT for GPR 1`] = `
|
||||
"<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<config>
|
||||
<add key="defaultPushSource" value="https://pkgs.dev.azure.com/amullans/_packaging/GitHubBuilds/nuget/v3/index.json"/>
|
||||
</config>
|
||||
<packageSourceCredentials>
|
||||
<AzureArtifacts>
|
||||
<add key="Username" value="OwnerName"/>
|
||||
<add key="ClearTextPassword" value="TEST_FAKE_AUTH_TOKEN"/>
|
||||
</AzureArtifacts>
|
||||
</packageSourceCredentials>
|
||||
</configuration>"
|
||||
`;
|
||||
|
||||
exports[`authutil tests existing config w/ GPR source and NuGet.org, sets up a partial NuGet.config user/PAT for GPR 1`] = `
|
||||
"<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<config>
|
||||
<add key="defaultPushSource" value="https://nuget.pkg.github.com/OwnerName/index.json"/>
|
||||
</config>
|
||||
<packageSourceCredentials>
|
||||
<GPR>
|
||||
<add key="Username" value="OwnerName"/>
|
||||
<add key="ClearTextPassword" value="TEST_FAKE_AUTH_TOKEN"/>
|
||||
</GPR>
|
||||
</packageSourceCredentials>
|
||||
</configuration>"
|
||||
`;
|
||||
|
||||
exports[`authutil tests existing config w/ no GPR sources, sets up a full NuGet.config with URL and user/PAT for GPR 1`] = `
|
||||
"<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<config>
|
||||
<add key="defaultPushSource" value="https://nuget.pkg.github.com/OwnerName/index.json"/>
|
||||
</config>
|
||||
<packageSources>
|
||||
<add key="Source" value="https://nuget.pkg.github.com/OwnerName/index.json"/>
|
||||
</packageSources>
|
||||
<packageSourceCredentials>
|
||||
<Source>
|
||||
<add key="Username" value="OwnerName"/>
|
||||
<add key="ClearTextPassword" value="TEST_FAKE_AUTH_TOKEN"/>
|
||||
</Source>
|
||||
</packageSourceCredentials>
|
||||
</configuration>"
|
||||
`;
|
||||
|
||||
exports[`authutil tests existing config w/ no sources, sets up a full NuGet.config with URL and user/PAT for GPR 1`] = `
|
||||
"<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<config>
|
||||
<add key="defaultPushSource" value="https://nuget.pkg.github.com/OwnerName/index.json"/>
|
||||
</config>
|
||||
<packageSources>
|
||||
<add key="Source" value="https://nuget.pkg.github.com/OwnerName/index.json"/>
|
||||
</packageSources>
|
||||
<packageSourceCredentials>
|
||||
<Source>
|
||||
<add key="Username" value="OwnerName"/>
|
||||
<add key="ClearTextPassword" value="TEST_FAKE_AUTH_TOKEN"/>
|
||||
</Source>
|
||||
</packageSourceCredentials>
|
||||
</configuration>"
|
||||
`;
|
||||
|
||||
exports[`authutil tests existing config w/ only Azure Artifacts source, sets up a partial NuGet.config user/PAT for GPR 1`] = `
|
||||
"<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<config>
|
||||
<add key="defaultPushSource" value="https://pkgs.dev.azure.com/amullans/_packaging/GitHubBuilds/nuget/v3/index.json"/>
|
||||
</config>
|
||||
<packageSourceCredentials>
|
||||
<AzureArtifacts>
|
||||
<add key="Username" value="OwnerName"/>
|
||||
<add key="ClearTextPassword" value="TEST_FAKE_AUTH_TOKEN"/>
|
||||
</AzureArtifacts>
|
||||
</packageSourceCredentials>
|
||||
</configuration>"
|
||||
`;
|
||||
|
||||
exports[`authutil tests existing config w/ only GPR source, sets up a partial NuGet.config user/PAT for GPR 1`] = `
|
||||
"<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<config>
|
||||
<add key="defaultPushSource" value="https://nuget.pkg.github.com/OwnerName/index.json"/>
|
||||
</config>
|
||||
<packageSourceCredentials>
|
||||
<GPR>
|
||||
<add key="Username" value="OwnerName"/>
|
||||
<add key="ClearTextPassword" value="TEST_FAKE_AUTH_TOKEN"/>
|
||||
</GPR>
|
||||
</packageSourceCredentials>
|
||||
</configuration>"
|
||||
`;
|
||||
|
||||
exports[`authutil tests existing config w/ two GPR sources, sets up a partial NuGet.config user/PAT for GPR 1`] = `
|
||||
"<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<config>
|
||||
<add key="defaultPushSource" value="https://nuget.pkg.github.com"/>
|
||||
</config>
|
||||
<packageSourceCredentials>
|
||||
<GPR-GitHub>
|
||||
<add key="Username" value="OwnerName"/>
|
||||
<add key="ClearTextPassword" value="TEST_FAKE_AUTH_TOKEN"/>
|
||||
</GPR-GitHub>
|
||||
<GPR-Actions>
|
||||
<add key="Username" value="OwnerName"/>
|
||||
<add key="ClearTextPassword" value="TEST_FAKE_AUTH_TOKEN"/>
|
||||
</GPR-Actions>
|
||||
</packageSourceCredentials>
|
||||
</configuration>"
|
||||
`;
|
||||
|
||||
exports[`authutil tests no existing config, sets up a full NuGet.config with URL and other owner/PAT for GPR 1`] = `
|
||||
"<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<config>
|
||||
<add key="defaultPushSource" value="https://nuget.pkg.github.com/otherorg/index.json"/>
|
||||
</config>
|
||||
<packageSources>
|
||||
<add key="Source" value="https://nuget.pkg.github.com/otherorg/index.json"/>
|
||||
</packageSources>
|
||||
<packageSourceCredentials>
|
||||
<Source>
|
||||
<add key="Username" value="otherorg"/>
|
||||
<add key="ClearTextPassword" value="TEST_FAKE_AUTH_TOKEN"/>
|
||||
</Source>
|
||||
</packageSourceCredentials>
|
||||
</configuration>"
|
||||
`;
|
||||
|
||||
exports[`authutil tests no existing config, sets up a full NuGet.config with URL and token for other source 1`] = `
|
||||
"<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<config>
|
||||
<add key="defaultPushSource" value="https://pkgs.dev.azure.com/amullans/_packaging/GitHubBuilds/nuget/v3/index.json"/>
|
||||
</config>
|
||||
<packageSources>
|
||||
<add key="Source" value="https://pkgs.dev.azure.com/amullans/_packaging/GitHubBuilds/nuget/v3/index.json"/>
|
||||
</packageSources>
|
||||
<packageSourceCredentials>
|
||||
<Source>
|
||||
<add key="Username" value="OwnerName"/>
|
||||
<add key="ClearTextPassword" value="TEST_FAKE_AUTH_TOKEN"/>
|
||||
</Source>
|
||||
</packageSourceCredentials>
|
||||
</configuration>"
|
||||
`;
|
||||
|
||||
exports[`authutil tests no existing config, sets up a full NuGet.config with URL and user/PAT for GPR 1`] = `
|
||||
"<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<config>
|
||||
<add key="defaultPushSource" value="https://nuget.pkg.github.com/OwnerName/index.json"/>
|
||||
</config>
|
||||
<packageSources>
|
||||
<add key="Source" value="https://nuget.pkg.github.com/OwnerName/index.json"/>
|
||||
</packageSources>
|
||||
<packageSourceCredentials>
|
||||
<Source>
|
||||
<add key="Username" value="OwnerName"/>
|
||||
<add key="ClearTextPassword" value="TEST_FAKE_AUTH_TOKEN"/>
|
||||
</Source>
|
||||
</packageSourceCredentials>
|
||||
</configuration>"
|
||||
`;
|
||||
336
__tests__/authutil.test.ts
Normal file
336
__tests__/authutil.test.ts
Normal file
@@ -0,0 +1,336 @@
|
||||
import * as io from '@actions/io';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
const fakeSourcesDirForTesting = path.join(
|
||||
__dirname,
|
||||
'runner',
|
||||
path.join(Math.random().toString(36).substring(7)),
|
||||
's'
|
||||
);
|
||||
|
||||
const invalidNuGetConfig = `<?xml version="1.0" encoding="utf-8"?>`;
|
||||
|
||||
const emptyNuGetConfig = `<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
</configuration>`;
|
||||
|
||||
const nugetorgNuGetConfig = `<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
||||
</packageSources>
|
||||
</configuration>`;
|
||||
|
||||
const gprnugetorgNuGetConfig = `<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="GPR" value="https://nuget.pkg.github.com/OwnerName/index.json" protocolVersion="3" />
|
||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
||||
</packageSources>
|
||||
</configuration>`;
|
||||
|
||||
const gprNuGetConfig = `<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="GPR" value="https://nuget.pkg.github.com/OwnerName/index.json" protocolVersion="3" />
|
||||
</packageSources>
|
||||
</configuration>`;
|
||||
|
||||
const twogprNuGetConfig = `<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="GPR-GitHub" value="https://nuget.pkg.github.com/OwnerName/index.json" protocolVersion="3" />
|
||||
<add key="GPR-Actions" value="https://nuget.pkg.github.com/actions/index.json" protocolVersion="3" />
|
||||
</packageSources>
|
||||
</configuration>`;
|
||||
|
||||
const spaceNuGetConfig = `<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="GPR GitHub" value="https://nuget.pkg.github.com/OwnerName/index.json" protocolVersion="3" />
|
||||
</packageSources>
|
||||
</configuration>`;
|
||||
|
||||
const azureartifactsNuGetConfig = `<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="AzureArtifacts" value="https://pkgs.dev.azure.com/amullans/_packaging/GitHubBuilds/nuget/v3/index.json" protocolVersion="3" />
|
||||
</packageSources>
|
||||
</configuration>`;
|
||||
|
||||
const azureartifactsnugetorgNuGetConfig = `<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="AzureArtifacts" value="https://pkgs.dev.azure.com/amullans/_packaging/GitHubBuilds/nuget/v3/index.json" protocolVersion="3" />
|
||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
||||
</packageSources>
|
||||
</configuration>`;
|
||||
|
||||
// We want a NuGet.config one level above the sources directory, so it doesn't trample a user's NuGet.config but is still picked up by NuGet/dotnet.
|
||||
const nugetConfigFile = path.join(fakeSourcesDirForTesting, '../nuget.config');
|
||||
|
||||
process.env['GITHUB_REPOSITORY'] = 'OwnerName/repo';
|
||||
import * as auth from '../src/authutil';
|
||||
|
||||
describe('authutil tests', () => {
|
||||
beforeEach(async () => {
|
||||
await io.rmRF(fakeSourcesDirForTesting);
|
||||
await io.mkdirP(fakeSourcesDirForTesting);
|
||||
}, 30000);
|
||||
|
||||
afterAll(async () => {
|
||||
await io.rmRF(fakeSourcesDirForTesting);
|
||||
}, 30000);
|
||||
|
||||
beforeEach(() => {
|
||||
if (fs.existsSync(nugetConfigFile)) {
|
||||
fs.unlinkSync(nugetConfigFile);
|
||||
}
|
||||
process.env['INPUT_OWNER'] = '';
|
||||
process.env['NUGET_AUTH_TOKEN'] = '';
|
||||
});
|
||||
|
||||
it('no existing config, sets up a full NuGet.config with URL and user/PAT for GPR', async () => {
|
||||
process.env['NUGET_AUTH_TOKEN'] = 'TEST_FAKE_AUTH_TOKEN';
|
||||
auth.configAuthentication(
|
||||
'https://nuget.pkg.github.com/OwnerName/index.json',
|
||||
'',
|
||||
fakeSourcesDirForTesting
|
||||
);
|
||||
expect(fs.existsSync(nugetConfigFile)).toBe(true);
|
||||
expect(
|
||||
fs.readFileSync(nugetConfigFile, {encoding: 'utf8'})
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('no existing config, auth token environment variable not provided, throws', async () => {
|
||||
let thrown = false;
|
||||
try {
|
||||
auth.configAuthentication(
|
||||
'https://nuget.pkg.github.com/OwnerName/index.json',
|
||||
'',
|
||||
fakeSourcesDirForTesting
|
||||
);
|
||||
} catch {
|
||||
thrown = true;
|
||||
}
|
||||
expect(thrown).toBe(true);
|
||||
});
|
||||
|
||||
it('no existing config, sets up a full NuGet.config with URL and other owner/PAT for GPR', async () => {
|
||||
process.env['NUGET_AUTH_TOKEN'] = 'TEST_FAKE_AUTH_TOKEN';
|
||||
process.env['INPUT_OWNER'] = 'otherorg';
|
||||
auth.configAuthentication(
|
||||
'https://nuget.pkg.github.com/otherorg/index.json',
|
||||
'',
|
||||
fakeSourcesDirForTesting
|
||||
);
|
||||
expect(fs.existsSync(nugetConfigFile)).toBe(true);
|
||||
expect(
|
||||
fs.readFileSync(nugetConfigFile, {encoding: 'utf8'})
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('existing config (invalid), tries to parse an invalid NuGet.config and throws', async () => {
|
||||
process.env['NUGET_AUTH_TOKEN'] = 'TEST_FAKE_AUTH_TOKEN';
|
||||
const inputNuGetConfigPath: string = path.join(
|
||||
fakeSourcesDirForTesting,
|
||||
'nuget.config'
|
||||
);
|
||||
fs.writeFileSync(inputNuGetConfigPath, invalidNuGetConfig);
|
||||
let thrown = false;
|
||||
try {
|
||||
auth.configAuthentication(
|
||||
'https://nuget.pkg.github.com/OwnerName/index.json',
|
||||
'',
|
||||
fakeSourcesDirForTesting
|
||||
);
|
||||
} catch {
|
||||
thrown = true;
|
||||
}
|
||||
expect(thrown).toBe(true);
|
||||
});
|
||||
|
||||
it('existing config w/ no sources, sets up a full NuGet.config with URL and user/PAT for GPR', async () => {
|
||||
process.env['NUGET_AUTH_TOKEN'] = 'TEST_FAKE_AUTH_TOKEN';
|
||||
const inputNuGetConfigPath: string = path.join(
|
||||
fakeSourcesDirForTesting,
|
||||
'nuget.config'
|
||||
);
|
||||
fs.writeFileSync(inputNuGetConfigPath, emptyNuGetConfig);
|
||||
auth.configAuthentication(
|
||||
'https://nuget.pkg.github.com/OwnerName/index.json',
|
||||
'',
|
||||
fakeSourcesDirForTesting
|
||||
);
|
||||
expect(fs.existsSync(nugetConfigFile)).toBe(true);
|
||||
expect(
|
||||
fs.readFileSync(nugetConfigFile, {encoding: 'utf8'})
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('existing config w/ no GPR sources, sets up a full NuGet.config with URL and user/PAT for GPR', async () => {
|
||||
process.env['NUGET_AUTH_TOKEN'] = 'TEST_FAKE_AUTH_TOKEN';
|
||||
const inputNuGetConfigPath: string = path.join(
|
||||
fakeSourcesDirForTesting,
|
||||
'nuget.config'
|
||||
);
|
||||
fs.writeFileSync(inputNuGetConfigPath, nugetorgNuGetConfig);
|
||||
auth.configAuthentication(
|
||||
'https://nuget.pkg.github.com/OwnerName/index.json',
|
||||
'',
|
||||
fakeSourcesDirForTesting
|
||||
);
|
||||
expect(fs.existsSync(nugetConfigFile)).toBe(true);
|
||||
expect(
|
||||
fs.readFileSync(nugetConfigFile, {encoding: 'utf8'})
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('existing config w/ only GPR source, sets up a partial NuGet.config user/PAT for GPR', async () => {
|
||||
process.env['NUGET_AUTH_TOKEN'] = 'TEST_FAKE_AUTH_TOKEN';
|
||||
const inputNuGetConfigPath: string = path.join(
|
||||
fakeSourcesDirForTesting,
|
||||
'nuget.config'
|
||||
);
|
||||
fs.writeFileSync(inputNuGetConfigPath, gprNuGetConfig);
|
||||
auth.configAuthentication(
|
||||
'https://nuget.pkg.github.com/OwnerName/index.json',
|
||||
'',
|
||||
fakeSourcesDirForTesting
|
||||
);
|
||||
expect(fs.existsSync(nugetConfigFile)).toBe(true);
|
||||
expect(
|
||||
fs.readFileSync(nugetConfigFile, {encoding: 'utf8'})
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('existing config w/ GPR source and NuGet.org, sets up a partial NuGet.config user/PAT for GPR', async () => {
|
||||
process.env['NUGET_AUTH_TOKEN'] = 'TEST_FAKE_AUTH_TOKEN';
|
||||
const inputNuGetConfigPath: string = path.join(
|
||||
fakeSourcesDirForTesting,
|
||||
'nuget.config'
|
||||
);
|
||||
fs.writeFileSync(inputNuGetConfigPath, gprnugetorgNuGetConfig);
|
||||
auth.configAuthentication(
|
||||
'https://nuget.pkg.github.com/OwnerName/index.json',
|
||||
'',
|
||||
fakeSourcesDirForTesting
|
||||
);
|
||||
expect(fs.existsSync(nugetConfigFile)).toBe(true);
|
||||
expect(
|
||||
fs.readFileSync(nugetConfigFile, {encoding: 'utf8'})
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('existing config w/ two GPR sources, sets up a partial NuGet.config user/PAT for GPR', async () => {
|
||||
process.env['NUGET_AUTH_TOKEN'] = 'TEST_FAKE_AUTH_TOKEN';
|
||||
const inputNuGetConfigPath: string = path.join(
|
||||
fakeSourcesDirForTesting,
|
||||
'nuget.config'
|
||||
);
|
||||
fs.writeFileSync(inputNuGetConfigPath, twogprNuGetConfig);
|
||||
auth.configAuthentication(
|
||||
'https://nuget.pkg.github.com',
|
||||
'',
|
||||
fakeSourcesDirForTesting
|
||||
);
|
||||
expect(fs.existsSync(nugetConfigFile)).toBe(true);
|
||||
expect(
|
||||
fs.readFileSync(nugetConfigFile, {encoding: 'utf8'})
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('existing config w/ spaces in key, throws for now', async () => {
|
||||
process.env['NUGET_AUTH_TOKEN'] = 'TEST_FAKE_AUTH_TOKEN';
|
||||
const inputNuGetConfigPath: string = path.join(
|
||||
fakeSourcesDirForTesting,
|
||||
'nuget.config'
|
||||
);
|
||||
fs.writeFileSync(inputNuGetConfigPath, spaceNuGetConfig);
|
||||
let thrown = false;
|
||||
try {
|
||||
auth.configAuthentication(
|
||||
'https://nuget.pkg.github.com/OwnerName/index.json',
|
||||
'',
|
||||
fakeSourcesDirForTesting
|
||||
);
|
||||
} catch {
|
||||
thrown = true;
|
||||
}
|
||||
expect(thrown).toBe(true);
|
||||
});
|
||||
|
||||
it('existing config not in repo root, sets up a partial NuGet.config user/PAT for GPR', async () => {
|
||||
process.env['NUGET_AUTH_TOKEN'] = 'TEST_FAKE_AUTH_TOKEN';
|
||||
const inputNuGetConfigDirectory: string = path.join(
|
||||
fakeSourcesDirForTesting,
|
||||
'subfolder'
|
||||
);
|
||||
const inputNuGetConfigPath: string = path.join(
|
||||
inputNuGetConfigDirectory,
|
||||
'nuget.config'
|
||||
);
|
||||
fs.mkdirSync(inputNuGetConfigDirectory, {recursive: true});
|
||||
fs.writeFileSync(inputNuGetConfigPath, gprNuGetConfig);
|
||||
auth.configAuthentication(
|
||||
'https://nuget.pkg.github.com/OwnerName/index.json',
|
||||
'subfolder/nuget.config',
|
||||
fakeSourcesDirForTesting
|
||||
);
|
||||
expect(fs.existsSync(nugetConfigFile)).toBe(true);
|
||||
expect(
|
||||
fs.readFileSync(nugetConfigFile, {encoding: 'utf8'})
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('existing config w/ only Azure Artifacts source, sets up a partial NuGet.config user/PAT for GPR', async () => {
|
||||
process.env['NUGET_AUTH_TOKEN'] = 'TEST_FAKE_AUTH_TOKEN';
|
||||
const inputNuGetConfigPath: string = path.join(
|
||||
fakeSourcesDirForTesting,
|
||||
'nuget.config'
|
||||
);
|
||||
fs.writeFileSync(inputNuGetConfigPath, azureartifactsNuGetConfig);
|
||||
auth.configAuthentication(
|
||||
'https://pkgs.dev.azure.com/amullans/_packaging/GitHubBuilds/nuget/v3/index.json',
|
||||
'',
|
||||
fakeSourcesDirForTesting
|
||||
);
|
||||
expect(fs.existsSync(nugetConfigFile)).toBe(true);
|
||||
expect(
|
||||
fs.readFileSync(nugetConfigFile, {encoding: 'utf8'})
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('existing config w/ Azure Artifacts source and NuGet.org, sets up a partial NuGet.config user/PAT for GPR', async () => {
|
||||
process.env['NUGET_AUTH_TOKEN'] = 'TEST_FAKE_AUTH_TOKEN';
|
||||
const inputNuGetConfigPath: string = path.join(
|
||||
fakeSourcesDirForTesting,
|
||||
'nuget.config'
|
||||
);
|
||||
fs.writeFileSync(inputNuGetConfigPath, azureartifactsnugetorgNuGetConfig);
|
||||
auth.configAuthentication(
|
||||
'https://pkgs.dev.azure.com/amullans/_packaging/GitHubBuilds/nuget/v3/index.json',
|
||||
'',
|
||||
fakeSourcesDirForTesting
|
||||
);
|
||||
expect(fs.existsSync(nugetConfigFile)).toBe(true);
|
||||
expect(
|
||||
fs.readFileSync(nugetConfigFile, {encoding: 'utf8'})
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('no existing config, sets up a full NuGet.config with URL and token for other source', async () => {
|
||||
process.env['NUGET_AUTH_TOKEN'] = 'TEST_FAKE_AUTH_TOKEN';
|
||||
auth.configAuthentication(
|
||||
'https://pkgs.dev.azure.com/amullans/_packaging/GitHubBuilds/nuget/v3/index.json',
|
||||
'',
|
||||
fakeSourcesDirForTesting
|
||||
);
|
||||
expect(fs.existsSync(nugetConfigFile)).toBe(true);
|
||||
expect(
|
||||
fs.readFileSync(nugetConfigFile, {encoding: 'utf8'})
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
101
__tests__/cache-restore.test.ts
Normal file
101
__tests__/cache-restore.test.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import {readdir} from 'node:fs/promises';
|
||||
import * as cache from '@actions/cache';
|
||||
import * as core from '@actions/core';
|
||||
import * as glob from '@actions/glob';
|
||||
import {restoreCache} from '../src/cache-restore';
|
||||
import {getNuGetFolderPath} from '../src/cache-utils';
|
||||
import {lockFilePatterns} from '../src/constants';
|
||||
|
||||
jest.mock('node:fs/promises');
|
||||
jest.mock('@actions/cache');
|
||||
jest.mock('@actions/core');
|
||||
jest.mock('@actions/glob');
|
||||
jest.mock('../src/cache-utils');
|
||||
|
||||
describe('cache-restore tests', () => {
|
||||
describe.each(lockFilePatterns)('restoreCache("%s")', lockFilePattern => {
|
||||
/** Store original process.env.GITHUB_WORKSPACE */
|
||||
let githubWorkspace: string | undefined;
|
||||
beforeAll(() => {
|
||||
githubWorkspace = process.env.GITHUB_WORKSPACE;
|
||||
jest.mocked(getNuGetFolderPath).mockResolvedValue({
|
||||
'global-packages': 'global-packages',
|
||||
'http-cache': 'http-cache',
|
||||
temp: 'temp',
|
||||
'plugins-cache': 'plugins-cache'
|
||||
});
|
||||
});
|
||||
beforeEach(() => {
|
||||
process.env.GITHUB_WORKSPACE = './';
|
||||
jest.mocked(glob.hashFiles).mockClear();
|
||||
jest.mocked(core.saveState).mockClear();
|
||||
jest.mocked(core.setOutput).mockClear();
|
||||
jest.mocked(cache.restoreCache).mockClear();
|
||||
});
|
||||
afterEach(() => (process.env.GITHUB_WORKSPACE = githubWorkspace));
|
||||
|
||||
it('throws error when lock file is not found', async () => {
|
||||
jest.mocked(glob.hashFiles).mockResolvedValue('');
|
||||
|
||||
await expect(restoreCache(lockFilePattern)).rejects.toThrow();
|
||||
|
||||
expect(jest.mocked(core.saveState)).not.toHaveBeenCalled();
|
||||
expect(jest.mocked(core.setOutput)).not.toHaveBeenCalled();
|
||||
expect(jest.mocked(cache.restoreCache)).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('does not call core.saveState("CACHE_RESULT") when cache.restoreCache() returns falsy', async () => {
|
||||
jest.mocked(glob.hashFiles).mockResolvedValue('hash');
|
||||
jest.mocked(cache.restoreCache).mockResolvedValue(undefined);
|
||||
|
||||
await restoreCache(lockFilePattern);
|
||||
|
||||
const expectedKey = `dotnet-cache-${process.env.RUNNER_OS}-hash`;
|
||||
expect(jest.mocked(core.saveState)).toHaveBeenCalledWith(
|
||||
'CACHE_KEY',
|
||||
expectedKey
|
||||
);
|
||||
expect(jest.mocked(core.saveState)).not.toHaveBeenCalledWith(
|
||||
'CACHE_RESULT',
|
||||
expectedKey
|
||||
);
|
||||
expect(jest.mocked(core.setOutput)).toHaveBeenCalledWith(
|
||||
'cache-hit',
|
||||
false
|
||||
);
|
||||
});
|
||||
|
||||
it('calls core.saveState("CACHE_RESULT") when cache.restoreCache() returns key', async () => {
|
||||
const expectedKey = `dotnet-cache-${process.env.RUNNER_OS}-hash`;
|
||||
jest.mocked(glob.hashFiles).mockResolvedValue('hash');
|
||||
jest.mocked(cache.restoreCache).mockResolvedValue(expectedKey);
|
||||
|
||||
await restoreCache(lockFilePattern);
|
||||
|
||||
expect(jest.mocked(core.saveState)).toHaveBeenCalledWith(
|
||||
'CACHE_KEY',
|
||||
expectedKey
|
||||
);
|
||||
expect(jest.mocked(core.saveState)).toHaveBeenCalledWith(
|
||||
'CACHE_RESULT',
|
||||
expectedKey
|
||||
);
|
||||
expect(jest.mocked(core.setOutput)).toHaveBeenCalledWith(
|
||||
'cache-hit',
|
||||
true
|
||||
);
|
||||
});
|
||||
|
||||
it('calls glob.hashFiles("/packages.lock.json") if cacheDependencyPath is falsy', async () => {
|
||||
const expectedKey = `dotnet-cache-${process.env.RUNNER_OS}-hash`;
|
||||
jest.mocked(glob.hashFiles).mockResolvedValue('hash');
|
||||
jest.mocked(cache.restoreCache).mockResolvedValue(expectedKey);
|
||||
jest.mocked(readdir).mockResolvedValue([lockFilePattern] as any);
|
||||
|
||||
await restoreCache('');
|
||||
|
||||
expect(jest.mocked(glob.hashFiles)).not.toHaveBeenCalledWith('');
|
||||
expect(jest.mocked(glob.hashFiles)).toHaveBeenCalledWith(lockFilePattern);
|
||||
});
|
||||
});
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user