Commit Graph

93 Commits

Author SHA1 Message Date
Oran Avraham
8b89ef08a0
Use correct Poetry config when collecting Poetry projects (#447)
* Use correct Poetry config when collecting Poetry projects

When collecting Poetry projects for caching, a '**/poetry.lock' glob is
used.  However, in order to process the Poetry configuration, the
"poetry" command is run from the repo's root directory; this causes
Poetry to return an invalid configuration when there is a Poetry project
inside an inner directory.

Instead of running a single Poetry command, glob for the same pattern,
and run a Poetry command for every discovered project.

* Fix typo: saveSatetSpy -> saveStateSpy

* poetry: Support same virtualenv appearing in multiple projects

* Add nested Poetry projects test

* poetry: Set up environment for each project individually

* tests/cache-restore: Do not look for dependency files outside `data`

When the default dependency path is used for cache distributors, they
are looking for the dependency file in the project's root (including the
source code), which leads to tests taking a significant amount of time,
especially on Windows runners.  We thus hit sporadic test failures.

Change the test cases such that dependency files are always searched for
inside of `__tests__/data`, ignoring the rest of the project.

* poetry: Simplify `virtualenvs.in-project` boolean check

* README: Explain that poetry might create multiple caches

* poetry: Run `poetry env use` only after cache is loaded

The virtualenv cache might contain invalid entries, such as virtualenvs
built in previous, buggy versions of this action.  The `poetry env use`
command will recreate virtualenvs in case they are invalid, but it has
to be run only *after* the cache is loaded.

Refactor `CacheDistributor` a bit such that the validation (and possible
recreation) of virtualenvs happens only after the cache is loaded.

* poetry: Bump cache primary key
2023-01-03 11:13:00 -05:00
Dmitry Shibanov
5ccb29d877
Install multiple python versions (#567) 2022-12-22 13:02:09 +01:00
Jongwoo Han
206e984b94
refactor: Use early return pattern to avoid nested conditions (#566)
* refactor: Use early return pattern

Signed-off-by: jongwooo <jongwooo.han@gmail.com>

* fix: Replace throw with warn

Signed-off-by: jongwooo <jongwooo.han@gmail.com>

Signed-off-by: jongwooo <jongwooo.han@gmail.com>
2022-12-19 14:00:46 +01:00
MaksimZhukov
2c3dd9e7e2
Add OS info to the error message (#559) 2022-12-07 18:12:42 +01:00
Sergey Dolin
4818a5a153
Handle download HTTP error (#511) 2022-10-24 11:10:18 +02:00
Vladimir Safonkin
8bcd2560e2
Add architecture input check for PyPy for Windows platform (#520)
* Revert cache index.js

* build cache index file

* Refactor

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Format code

* Rebuild dist

* Minor refactor

* Format code

* Minor fixes

* Check platform firstly
2022-10-18 11:01:15 +02:00
ChristopherHX
98c991d13f
Only use github.token on github.com (#443)
* Only use github.token on github.com

This expression evaluates to `''` if called from GHES hosted elsewhere
You can still provide your token on both github.com and GHES

* Enshure blank result of expression and not false

* Revert "Revert "Pass the `token` input through on GHES (#427)" (#437)"

This reverts commit cf86e08a31.

* fix typo

* Add back the doc on the tool cache for self-hosted

Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com>
2022-08-30 15:02:20 -04:00
Leon Wright
7e39d25e3f
refactor: Debug message for Python installation path 2022-07-26 20:40:49 +08:00
Leon Wright
bc8ee42330
fix: Mac Toolpath
Shared libraries for the Mac python builds are not configured with the
relocatable flag, thus must always be configured with the hosted path.

Relates #459
2022-07-26 19:40:29 +08:00
Leon Wright
467a981225
feat: Add 'IS_MAC' util 2022-07-26 19:38:18 +08:00
Leon Wright
9f1915a970
fix: Self-Hosted Tool Cache
This fixes the tool cache path for self-hosted runners, along
with handling AGENT_TOOLSDIRECTORY for both hosted + self-hosted.

    Fixes actions#459
2022-07-26 19:37:39 +08:00
Dmitry Shibanov
2f06e9da25
Add check-latest functionality (#406) 2022-07-25 16:54:04 +02:00
Dmitry Shibanov
49a521fa06
Fix poetry version (#445) 2022-07-25 15:02:06 +02:00
Milos Pantic
592a7a7a45
Add linux os release info to primary key (#467) 2022-07-19 14:20:19 +02:00
IvanZosimov
b88a682917 Fix resolveVersionInput() logic 2022-07-15 16:52:20 +02:00
Marko Zivic
0ad0f6a0a5
Merge pull request #452 from mayeut/fix-env
Remove duplicate code introduced in #440
2022-07-06 16:11:51 +02:00
Marko Zivic
364e819741
Merge pull request #394 from akv-platform/v-sedoli/set-env-by-default
Assign default value of AGENT_TOOLSDIRECTORY if not set
2022-07-04 10:35:46 +02:00
mayeut
2c9de4ed41
Remove duplicate code introduced in #440
#440 duplicated a block of code outside of `if (updateEnvironment) {` condition. This was probably an oversight when merging `main` back on the PR branch. The tests should have seen that `core.exportVariable` was being called and should have failed.
2022-07-02 11:50:48 +02:00
IvanZosimov
099ed898be Optimize code 2022-06-30 18:42:04 +02:00
IvanZosimov
ccb7da8ae9 Change warning handler to default 2022-06-30 18:28:17 +02:00
IvanZosimov
5fbb819407 Optimize logic, rebuild action 2022-06-30 17:32:12 +02:00
IvanZosimov
82eddc4023 Add warning in case the versionFile isn't found 2022-06-30 16:34:29 +02:00
IvanZosimov
d97b6edda3 Fix typos 2022-06-30 16:25:46 +02:00
IvanZosimov
84087f5301 Rearrange logic 2022-06-30 16:21:14 +02:00
IvanZosimov
56f6060254 Fix naming 2022-06-30 14:41:09 +02:00
IvanZosimov
e29a7c89f6 Merge branch 'main' into ResolveVersionFix 2022-06-30 14:40:24 +02:00
IvanZosimov
161c3a68f0 Merge branch 'main' into CacheLibVersionUpdate 2022-06-30 14:18:06 +02:00
IvanZosimov
6733fc44ec Fix typo 2022-06-30 13:44:10 +02:00
IvanZosimov
afd3e72a25 Fix bug in resolveVersionInput() 2022-06-30 13:38:43 +02:00
Sergey Dolin
e629242ad4 Fix failed check 2022-06-30 07:56:08 +02:00
Sergey Dolin
69b94463f5 Add CMake hints 2022-06-30 07:43:57 +02:00
Matthieu Darbois
00a5248c77
feature: add update-environment input (#411)
This option allows to specify if the action shall update environment variables (default) or not.
This allows to use the setup-python action in a composite action without side effect (except downloading/installing python if version is missing).
2022-06-29 11:00:51 -04:00
Sergey Dolin
958897304a Exclude windows from the fix 2022-06-29 11:22:07 +02:00
Sergey Dolin
5d9fdcab75 Handle each OS in its own way 2022-06-29 11:22:07 +02:00
Sergey Dolin
a8da2a66aa Use /opt/hostedtoolcache as default value AGENT_TOOLSDIRECTORY 2022-06-29 11:21:21 +02:00
IvanZosimov
01408cef88 Update cache-save.ts to support @actions/cache v3.0.0 lib
Made package.json and package-lock.json to use @actions/cache v3.0.0,
updated logic of the cache-save operation and added unit-tests
2022-06-28 15:17:50 +02:00
Kurt von Laven
ffcd00020c
Allow python-version-file to be a relative path (#431) 2022-06-20 16:04:59 +02:00
Brian Cristante
cf86e08a31
Revert "Pass the token input through on GHES (#427)" (#437)
This reverts commit 7e4abae443.
2022-06-16 11:08:06 -04:00
Brian Cristante
7e4abae443
Pass the token input through on GHES (#427)
* Pass the`token` input through on GHES

* Update the description for `token`

* Fix dist files

* Update package-lock.json

* Update README

* Fix indent level in YAML snippet

* secret names can't start with GITHUB_
2022-06-13 14:55:47 -04:00
Matthieu Darbois
d09bd5e600
fix: 3.x-dev can install a 3.y version (#417)
* fix: 3.x-dev can install a 3.y version

* Update README section for `-dev`
2022-06-08 14:58:05 +02:00
Ivan
f72db171ab
Made env.var pythonLocation consistent for Python and PyPy (#418)
* Change find-pypy.ts to redefine pythonLocaction environment variable

* Change README.md in order to add sentence about pythonLocation envvar

* Change sentence about pythonLocation envvar in README.md

* Rephrase the definition of pythonLocation env.var
2022-06-08 14:57:23 +02:00
Andrew DiLosa
53e15292cd
add support for python-version-file (#336)
* add support for python-version-file

* Update action.yml

* update to v4, remove python-version default

* python-version overrides python-version-file, like setup-node
* checks '.python-version' by default if nothing else specified

* update tests, update to checkout@v3

* update build

* appease the linter

* remove old test for default python version

* revert readme changes

* update build
2022-06-02 16:37:57 +02:00
Dmitry Shibanov
3f82819745
Fix output for prerelease version of poetry (#409) 2022-05-31 15:48:54 +02:00
mayeut
ff706563d7
feature: add a python-path output
Expose a `python-path` output containing the chosen Python executable path.
2022-05-24 21:02:03 +02:00
Matthieu Darbois
fff15a21cc
Use pypyX.Y for PyPy python-version input (#349)
This versioning scheme is consistent with other
tools in the python ecosystem so it feels more natural
and allows better interaction with other tools.

fixes #346
2022-05-18 15:20:53 +02:00
Marko Zivic
fd8f0a9fb8
Merge pull request #396 from akv-platform/v-sedoli/issue-241
Add warning if python version set to empty value
2022-05-04 15:21:43 +02:00
Marko Zivic
ae11205ec6
Merge pull request #400 from akv-platform/v-sedoli/pkg-config
set PKG_CONFIG_PATH environment var
2022-05-04 09:56:28 +02:00
Sergey Dolin
8f73c1495f Formatting 2022-05-04 12:55:36 +05:00
Sergey Dolin
e31727ce0a
Improve warning message
Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com>
2022-05-04 12:43:58 +05:00
Brian Cristante
a69041ca9f
Successfully set up (#399) 2022-05-03 08:43:53 -04:00