Skip to content

Commit fbb12fd

Browse files
Make caching feature node version agnostic
1 parent 543ccf0 commit fbb12fd

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

.github/workflows/test.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ on:
66
pull_request:
77
branches: [main]
88

9-
env:
9+
#env:
1010
# This is required to support GLIB versions present in amazon linux 2. Can be removed once amazon linux 2 is 💀
1111
# More info
1212
# - https://github.com/actions/checkout/issues/1809#issuecomment-2208202462
1313
# - https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
14-
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
14+
# ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
1515

1616
jobs:
1717
test_python_installation:
@@ -32,7 +32,9 @@ jobs:
3232
run: |
3333
yum install -y git tar gzip sudo which
3434
35-
- uses: actions/checkout@v3
35+
- name: Checkout
36+
run: |
37+
git clone --depth 1 -b "${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}" "https://github.com/${GITHUB_REPOSITORY}.git" .
3638
3739
- name: Install python
3840
uses: ./
@@ -79,7 +81,9 @@ jobs:
7981
- name: Setup runner
8082
run: yum install -y git tar gzip sudo
8183

82-
- uses: actions/checkout@v3
84+
- name: Checkout
85+
run: |
86+
git clone --depth 1 -b "${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}" "https://github.com/${GITHUB_REPOSITORY}.git" .
8387
8488
- name: Install python
8589
uses: ./
@@ -105,7 +109,9 @@ jobs:
105109
run: |
106110
yum install -y git tar gzip sudo
107111
108-
- uses: actions/checkout@v3
112+
- name: Checkout
113+
run: |
114+
git clone --depth 1 -b "${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}" "https://github.com/${GITHUB_REPOSITORY}.git" .
109115
110116
- name: Install python
111117
uses: ./
@@ -129,7 +135,9 @@ jobs:
129135
run: |
130136
yum install -y git tar gzip sudo
131137
132-
- uses: actions/checkout@v3
138+
- name: Checkout
139+
run: |
140+
git clone --depth 1 -b "${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}" "https://github.com/${GITHUB_REPOSITORY}.git" .
133141
134142
- name: Create python version file
135143
run: |

action.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ runs:
3232
exact_python_version="${{ steps.find-exact-python-version.outputs.exact_python_version }}"
3333
echo "installation_directory=${HOME}/.setup-python-amazon-linux/.python-versions/${exact_python_version}" >> $GITHUB_OUTPUT
3434
35-
- name: Cache
36-
id: cache-python
37-
uses: actions/cache@v3
38-
if: inputs.cache == 'true'
39-
with:
40-
path: ${{ steps.set-installation-directory.outputs.installation_directory }}
41-
key: python-${{ steps.find-exact-python-version.outputs.exact_python_version }}-${{ runner.arch }}
35+
# - name: Cache
36+
# id: cache-python
37+
# uses: actions/cache@v3
38+
# if: inputs.cache == 'true'
39+
# with:
40+
# path: ${{ steps.set-installation-directory.outputs.installation_directory }}
41+
# key: python-${{ steps.find-exact-python-version.outputs.exact_python_version }}-${{ runner.arch }}
4242

4343
- id: setup-python
4444
shell: bash
45-
if: inputs.cache == 'false' || (inputs.cache == 'true' && steps.cache-python.outputs.cache-hit != 'true')
45+
# if: inputs.cache == 'false' || (inputs.cache == 'true' && steps.cache-python.outputs.cache-hit != 'true')
4646
run: |
4747
installation_directory="${{ steps.set-installation-directory.outputs.installation_directory }}"
4848
exact_python_version="${{ steps.find-exact-python-version.outputs.exact_python_version }}"
@@ -61,7 +61,7 @@ runs:
6161
6262
echo "The following python binaries are now available in the PATH"
6363
ls "${installation_directory}/bin"
64-
64+
6565
echo "Linking python libraries..."
6666
ls "${installation_directory}/lib"
6767
sudo ldconfig "${installation_directory}/lib"

0 commit comments

Comments
 (0)