-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(plone-package-test-notify): INSTALL_DEPENDENCIES_COMMANDS input
* fix(plone-package-test-notify): export path * feat(plone-package-test-notify): python_version is optional * fix(plone-package-test-notify): do not export path * feat(plone-package-test-notify): only install curl and git if not already installed * feat(plone-package-test-notify): sort inputs * feat(plone-package-test-notify): INSTALL_DEPENDENCIES_COMMANDS input
- Loading branch information
Showing
3 changed files
with
44 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,36 @@ | ||
name: Run code analysis | ||
description: Run code analysis and notify on Mattermost | ||
inputs: | ||
BUILDOUT_CONFIG_FILE: | ||
description: 'Path to buildout configuration file' | ||
required: true | ||
default: "buildout.cfg" | ||
CACHE_KEY: | ||
description: 'Cache key' | ||
required: false | ||
INSTALL_DEPENDENCIES_COMMANDS: | ||
description: 'Commands to install dependencies' | ||
required: false | ||
MATTERMOST_WEBHOOK_URL: | ||
description: 'Webhook URL to send notifications on Mattermost, if not provided, notifications will not be sent' | ||
required: false | ||
PYTHON_VERSION: | ||
description: 'Python version to use' | ||
required: true | ||
default: "3.10" | ||
required: false | ||
TEST_COMMAND: | ||
description: 'Command to run tests' | ||
required: true | ||
default: "bin/test" | ||
REQUIREMENTS_FILE: | ||
description: 'Path to requirements file' | ||
required: true | ||
default: "requirements.txt" | ||
BUILDOUT_CONFIG_FILE: | ||
description: 'Path to buildout configuration file' | ||
required: true | ||
default: "buildout.cfg" | ||
MATTERMOST_WEBHOOK_URL: | ||
description: 'Webhook URL to send notifications on Mattermost, if not provided, notifications will not be sent' | ||
required: false | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Install curl | ||
run: sudo apt-get update && sudo apt-get install -y curl git | ||
- name: Install curl and git | ||
run: | | ||
if which curl > /dev/null && which git > /dev/null; then | ||
echo "curl and git are already installed" | ||
else | ||
sudo apt-get update && sudo apt-get install -y curl git | ||
fi | ||
shell: bash | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -39,14 +42,21 @@ runs: | |
with: | ||
path: ./eggs | ||
key: ${{ inputs.CACHE_KEY }} | ||
- name: Setup Python ${{ inputs.PYTHON_VERSION }} | ||
- name: Setup Python | ||
if: ${{ inputs.PYTHON_VERSION != '' }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ inputs.PYTHON_VERSION }} | ||
- name: Install dependencies | ||
if: ${{ inputs.INSTALL_DEPENDENCIES_COMMANDS != '' }} | ||
shell: bash | ||
run: | | ||
pip install -r ${{ inputs.REQUIREMENTS_FILE }} | ||
set +e | ||
IFS=$'\n' read -r -d '' -a commands <<< "${{ inputs.INSTALL_DEPENDENCIES_COMMANDS }}" | ||
for command in "${commands[@]}"; do | ||
echo "Running command: $command" | ||
$command | ||
done | ||
- name: Run buildout | ||
shell: bash | ||
run: | | ||
|