From ec3e0a98ef98d7ef104ef1044bdaaa6fece5e34a Mon Sep 17 00:00:00 2001 From: Peter Van Dyken Date: Mon, 11 Dec 2023 16:45:18 -0500 Subject: [PATCH] Switch to centralized install action --- .github/actions/install-project/action.yml | 50 ---------------------- .github/workflows/test.yml | 9 ++-- 2 files changed, 3 insertions(+), 56 deletions(-) delete mode 100644 .github/actions/install-project/action.yml diff --git a/.github/actions/install-project/action.yml b/.github/actions/install-project/action.yml deleted file mode 100644 index d42a612d..00000000 --- a/.github/actions/install-project/action.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Install Project -description: Install Snakebids and its dependencies -inputs: - python-version: - required: true - description: Python version to install - poetry-cache-id: - default: ${{ github.event.pull_request.id || github.event.after }} - description: > - Reference ID to use for defining poetry cache (e.g. pull request id - or commit SHA) - -runs: - using: composite - steps: - # install & configure poetry - - name: Cache Poetry Installation - id: cached-poetry - uses: actions/cache@v3 - with: - path: ~/.local - key: ${{ runner.os }}-poetry-${{ inputs.poetry-cache-id }} - - name: Install Poetry - uses: snok/install-poetry@v1 - if: steps.cached-poetry.outputs.cache-hit != 'true' - with: - virtualenvs-create: true - virtualenvs-in-project: true - - - name: Setup Python - id: setup-python - uses: actions/setup-python@v4 - with: - python-version: ${{ inputs.python-version }} - cache: 'poetry' - - name: Store Pip Cache - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ steps.setup-python.outputs.python-version }} - restore-keys: ${{ runner.os }}-pip-${{ steps.setup-python.outputs.python-version }} - - # install dependencies - - name: Install dependencies - shell: bash - if: steps.setup-python.outputs.cache-hit != 'true' - run: poetry install --no-interaction --no-ansi --no-root - - name: Install library - shell: bash - run: poetry install --no-interaction --no-ansi diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2cc48fa8..0fbb81cf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,12 +18,11 @@ jobs: runs-on: ubuntu-latest steps: - - name: Clone repo - uses: actions/checkout@v3 - name: Install - uses: ./.github/actions/install-project + uses: khanlab/actions/.github/actions/action-setup_task-installPyProject with: python-version: '3.11' + install-library: true # run python style checks - name: Poetry Lock Check @@ -86,10 +85,8 @@ jobs: split: ['1', '2', '3', '4', '5'] fail-fast: false steps: - - name: Clone repo - uses: actions/checkout@v3 - name: install - uses: ./.github/actions/install-project + uses: khanlab/actions/.github/actions/action-setup_task-installPyProject with: python-version: ${{ matrix.python-version }} reference: ${{ github.event.pull_request.id || github.event.after }}