From a5643c67b5fcc9ac5eddb395c7f61b1b66d86034 Mon Sep 17 00:00:00 2001 From: Yurii Serhiichuk Date: Fri, 29 Dec 2023 02:00:19 +0200 Subject: [PATCH] feat: Add ability to install plugins as part of the action setup (#66) * Use latest SemVer PR * Drop EOL Python 3.7. Use more modern Poetry versions in tests * Update examples * Add ability to install plugins and install export plugin by default * Do not install any plugins by default * Only run steps if some plugins are specified --- .github/workflows/ci.yml | 10 +++++----- .github/workflows/lint-pr.yml | 2 +- README.md | 10 +++++----- action.yml | 11 +++++++++++ 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 310330d..9580f8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,13 +10,13 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - poetry-version: ["latest", "1.0", "1.1.15", "1.2.2", "1.3.1"] - os: [ubuntu-20.04, macos-latest, windows-latest] + python-version: ["3.8", "3.9", "3.10", "3.11"] + poetry-version: ["latest", "1.2.2", "1.3.2", "1.4.2", "1.5.1", "1.6.1"] + os: [ubuntu-22.04, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Run image diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml index d57813e..295d4f8 100644 --- a/.github/workflows/lint-pr.yml +++ b/.github/workflows/lint-pr.yml @@ -10,6 +10,6 @@ jobs: main: runs-on: ubuntu-latest steps: - - uses: amannn/action-semantic-pull-request@v3.4.0 + - uses: amannn/action-semantic-pull-request@v5.4.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 02c9902..afaf15b 100644 --- a/README.md +++ b/README.md @@ -29,12 +29,12 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] - poetry-version: ["1.0", "1.1.15"] - os: [ubuntu-18.04, macos-latest, windows-latest] + python-version: ["3.8", "3.9", "3.10", "3.11"] + poetry-version: ["1.2.2", "1.7.1"] + os: [ubuntu-22.04, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -80,7 +80,7 @@ jobs: ci: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Python uses: actions/setup-python@v4 # see details (matrix, python-version, python-version-file, etc.) diff --git a/action.yml b/action.yml index cdf9323..2d63212 100644 --- a/action.yml +++ b/action.yml @@ -9,6 +9,10 @@ inputs: description: "The version of poetry to install" required: false default: "latest" + poetry-plugins: + description: "The whitespace/newline-separated list of poetry plugins to install." + required: false + default: "" runs: using: "composite" steps: @@ -20,3 +24,10 @@ runs: run: | pip install poetry==${{ inputs.poetry-version }} shell: bash + - if: ${{ inputs.poetry-plugins != '' }} + run: | + ALL_PLUGINS=$(echo "${{ inputs.poetry-plugins }}") + for PLUGIN in $ALL_PLUGINS; do + poetry self add $PLUGIN + done + shell: bash