Skip to content

Commit eaae0d8

Browse files
committed
Upgrade the Ubuntu runner
1 parent ee3b26a commit eaae0d8

File tree

1 file changed

+55
-13
lines changed

1 file changed

+55
-13
lines changed

.github/workflows/ci.yml

Lines changed: 55 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ on:
77
jobs:
88
unit-tests:
99
name: Test on Python v${{ matrix.python-version }}
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111
strategy:
1212
matrix:
1313
include:
1414
- pipenv-version: '2022.4.8'
1515
python-version: '3.6'
16+
install-with: pyenv
1617
- pipenv-version: '2022.4.8'
1718
python-version: '3.7'
19+
install-with: pyenv
1820
- pipenv-version: '2022.4.8'
1921
python-version: '3.8'
2022
- pipenv-version: '2022.4.8'
@@ -30,15 +32,25 @@ jobs:
3032

3133
steps:
3234
- name: Checkout the repository
33-
uses: actions/checkout@v2
35+
uses: actions/checkout@v4
3436
with:
3537
persist-credentials: false
3638

3739
- name: Install build essentials
3840
run: sudo apt-get --yes install build-essential
3941

40-
- name: Set up Python
41-
uses: actions/setup-python@v2
42+
- name: Install Python via pyenv
43+
if: matrix.install-with == 'pyenv'
44+
run: |
45+
PYENV_GIT_TAG='v2.6.11'
46+
curl https://pyenv.run | bash
47+
export PATH="$HOME/.pyenv/bin:$PATH"
48+
eval "$(pyenv init -)"
49+
pyenv install ${{ matrix.python-version }} pyenv global ${{ matrix.python-version }} echo "$HOME/.pyenv/shims" >> $GITHUB_PATH
50+
51+
- name: Install Python via actions/setup-python
52+
if: matrix.install-with == null || matrix.install-with == 'actions/setup'
53+
uses: actions/setup-python@v6
4254
with:
4355
python-version: ${{ matrix.python-version }}
4456

@@ -57,15 +69,25 @@ jobs:
5769

5870
steps:
5971
- name: Checkout the repository
60-
uses: actions/checkout@v2
72+
uses: actions/checkout@v4
6173
with:
6274
persist-credentials: false
6375

6476
- name: Install build essentials
6577
run: sudo apt-get --yes install build-essential
6678

67-
- name: Set up Python
68-
uses: actions/setup-python@v2
79+
- name: Install Python via pyenv
80+
if: matrix.install-with == 'pyenv'
81+
run: |
82+
PYENV_GIT_TAG='v2.6.11'
83+
curl https://pyenv.run | bash
84+
export PATH="$HOME/.pyenv/bin:$PATH"
85+
eval "$(pyenv init -)"
86+
pyenv install ${{ matrix.python-version }} pyenv global ${{ matrix.python-version }} echo "$HOME/.pyenv/shims" >> $GITHUB_PATH
87+
88+
- name: Install Python via actions/setup-python
89+
if: matrix.install-with == null || matrix.install-with == 'actions/setup'
90+
uses: actions/setup-python@v6
6991

7092
- name: Install dependencies
7193
run: |
@@ -82,15 +104,25 @@ jobs:
82104

83105
steps:
84106
- name: Checkout the repository
85-
uses: actions/checkout@v2
107+
uses: actions/checkout@v4
86108
with:
87109
persist-credentials: false
88110

89111
- name: Install build essentials
90112
run: sudo apt-get --yes install build-essential
91113

92-
- name: Set up Python
93-
uses: actions/setup-python@v2
114+
- name: Install Python via pyenv
115+
if: matrix.install-with == 'pyenv'
116+
run: |
117+
PYENV_GIT_TAG='v2.6.11'
118+
curl https://pyenv.run | bash
119+
export PATH="$HOME/.pyenv/bin:$PATH"
120+
eval "$(pyenv init -)"
121+
pyenv install ${{ matrix.python-version }} pyenv global ${{ matrix.python-version }} echo "$HOME/.pyenv/shims" >> $GITHUB_PATH
122+
123+
- name: Install Python via actions/setup-python
124+
if: matrix.install-with == null || matrix.install-with == 'actions/setup'
125+
uses: actions/setup-python@v6
94126

95127
- name: Install dependencies
96128
run: |
@@ -115,15 +147,25 @@ jobs:
115147

116148
steps:
117149
- name: Checkout the repository
118-
uses: actions/checkout@v2
150+
uses: actions/checkout@v4
119151
with:
120152
persist-credentials: false
121153

122154
- name: Install build essentials
123155
run: sudo apt-get --yes install build-essential
124156

125-
- name: Set up Python
126-
uses: actions/setup-python@v2
157+
- name: Install Python via pyenv
158+
if: matrix.install-with == 'pyenv'
159+
run: |
160+
PYENV_GIT_TAG='v2.6.11'
161+
curl https://pyenv.run | bash
162+
export PATH="$HOME/.pyenv/bin:$PATH"
163+
eval "$(pyenv init -)"
164+
pyenv install ${{ matrix.python-version }} pyenv global ${{ matrix.python-version }} echo "$HOME/.pyenv/shims" >> $GITHUB_PATH
165+
166+
- name: Install Python via actions/setup-python
167+
if: matrix.install-with == null || matrix.install-with == 'actions/setup'
168+
uses: actions/setup-python@v6
127169

128170
- name: Install dependencies
129171
run: |

0 commit comments

Comments
 (0)