Skip to content

Commit d7f3073

Browse files
authored
Merge pull request #4 from pybuilder/gh_284_conditional_action_steps
Rewrite to support conditional action steps
2 parents 225feb5 + ce90b5e commit d7f3073

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
- '3.10.0-rc.2'
2323
- '3.9'
2424
- 'pypy-3.7'
25+
- 'pypy-3.8'
2526
with-venv:
2627
- 'true'
2728
- 'false'

action.yml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,31 +58,25 @@ runs:
5858
PV="${PV##pypy-}"
5959
echo "PYTHON=python${PV%%.*}" >> $GITHUB_ENV
6060
- name: Checkout
61-
uses: ChristopherHX/conditional@main
62-
with:
63-
if: ${{inputs.checkout == 'true'}}
64-
step: |
65-
uses: actions/checkout@v2
61+
if: inputs.checkout == 'true'
62+
uses: actions/checkout@v2
6663
- name: Setup Python
67-
uses: ChristopherHX/conditional@main
64+
if: inputs.install-python == 'true' && (runner.os != 'macOS' || inputs.homebrew-python != 'true')
65+
uses: actions/setup-python@v2
6866
with:
69-
if: ${{ inputs.install-python == 'true' && (runner.os != 'macOS'|| inputs.homebrew-python != 'true') }}
70-
step: |
71-
uses: actions/setup-python@v2
72-
with:
73-
python-version: '${{ inputs.python-version }}'
74-
architecture: '${{ inputs.architecture }}'
67+
python-version: '${{ inputs.python-version }}'
68+
architecture: '${{ inputs.architecture }}'
7569
- name: Setup Python with Homebrew
7670
shell: bash
71+
if: inputs.install-python == 'true' && runner.os == 'macOS' && inputs.homebrew-python == 'true'
7772
run: |
78-
if ! [ '${{inputs.install-python}}' == 'true' -a '${{runner.os}}' == 'macOS' -a '${{inputs.homebrew-python}}' == 'true' ]; then exit 0; fi
7973
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
8074
brew reinstall 'python@${{ inputs.python-version }}'
8175
echo "/usr/local/opt/python@${{ inputs.python-version }}/bin" >> $GITHUB_PATH
8276
- name: Create VEnv
8377
shell: bash
78+
if: inputs.with-venv == 'true'
8479
run: |
85-
if ! [ '${{inputs.with-venv}}' == 'true' ]; then exit 0; fi
8680
$PYTHON -m pip install virtualenv
8781
virtualenv $HOME/.pyb
8882
echo "$HOME/.pyb/bin" >> $GITHUB_PATH
@@ -95,8 +89,8 @@ runs:
9589
$PYTHON -m pip --version
9690
- name: Install PyBuilder
9791
shell: bash
92+
if: inputs.install-pyb == 'true'
9893
run: |
99-
if ! [ '${{inputs.install-pyb}}' == 'true' ]; then exit 0; fi
10094
$PYTHON -m pip install 'pybuilder${{ inputs.pyb-version }}'
10195
which pyb
10296
pyb --version

0 commit comments

Comments
 (0)