From 54870ec091fbd1a964b6496e1ad4fb4053d6a73c Mon Sep 17 00:00:00 2001 From: Jason Kai Date: Tue, 26 Sep 2023 07:30:12 -0400 Subject: [PATCH 1/2] Update reusable workflows - Updates to the latest version of existing workflows - Makes use of composite action to setup Python environment --- .github/workflows/bump_version.yml | 4 +- .github/workflows/release.yml | 6 +-- .github/workflows/test.yml | 59 ++++-------------------------- 3 files changed, 13 insertions(+), 56 deletions(-) diff --git a/.github/workflows/bump_version.yml b/.github/workflows/bump_version.yml index 893430d3..96b60ecc 100644 --- a/.github/workflows/bump_version.yml +++ b/.github/workflows/bump_version.yml @@ -6,6 +6,6 @@ on: jobs: bump-version: if: github.event.pull_request.merged == true - uses: khanlab/actions/.github/workflows/workflow-version_task-semverGithub.yml@v0.1.0 + uses: khanlab/actions/.github/workflows/workflow-version_task-semverGithub.yml@maint/semver secrets: - BP_PAT: ${{ secrets.BP_PAT_TOKEN }} + BP-PAT: ${{ secrets.BP_PAT_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a443a705..372d8efe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,9 +8,9 @@ on: required: false jobs: release_package: - uses: khanlab/actions/.github/workflows/workflow-release_task-publishGithub.yml@v0.1.0 + uses: khanlab/actions/.github/workflows/workflow-release_task-publishGithub.yml@maint/semver with: comments: ${{ github.event.inputs.comments }} - pipeline_description: true + pipeline-description: true secrets: - BP_PAT: ${{ secrets.BP_PAT_TOKEN }} + BP-PAT: ${{ secrets.BP_PAT_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index efe60b55..09d13dd3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,40 +2,19 @@ name: Lint and test workflow on: push: - branches: ['*', '!push-action/*'] + branches: ["*", "!push-action/*"] pull_request: - branches: ['*', '!push-action/*'] + branches: ["*", "!push-action/*"] jobs: quality: name: Lint code if: github.event.pull_request.merged == false runs-on: ubuntu-latest steps: - - name: Clone repo - uses: actions/checkout@master - - name: Setup Python 3.10 - uses: actions/setup-python@v4 + - name: Setup Python environment + uses: khanlab/actions/.github/actions/action-setup_task-installPyProject@main with: - python-version: '3.10' - - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-3.10 - restore-keys: ${{ runner.os }}-pip-3.10 - - name: Install Poetry - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v3 - with: - path: .venv - key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-3.10 - - name: Install dependencies - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: poetry install --no-interaction --no-root --with dev + python-version: "3.10" - name: yamlfix run: poetry run poe yamlfix-check - name: isort @@ -51,34 +30,12 @@ jobs: needs: [quality] strategy: matrix: - python-version: ['3.8', '3.9', '3.10'] + python-version: ["3.8", "3.9", "3.10"] steps: - - name: Clone repo - uses: actions/checkout@master - - name: Select Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - name: Setup Python environments + uses: khanlab/actions/.github/actions/action-setup_task-installPyProject@main with: python-version: ${{ matrix.python-version }} - - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ matrix.python-version }} - restore-keys: ${{ runner.os }}-pip-${{ matrix.python-version }} - - name: Install Poetry - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v3 - with: - path: .venv - key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version - }} - - name: Install dependencies - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: poetry install --no-interaction --no-root --with dev - name: Test minimum inputs run: poetry run poe test_base - name: Test freesurfer input From e995ccfec55380e94f8c7391e892921bb643ba66 Mon Sep 17 00:00:00 2001 From: Jason Kai Date: Tue, 26 Sep 2023 07:51:05 -0400 Subject: [PATCH 2/2] Update version of action called --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 09d13dd3..fff92614 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Setup Python environment - uses: khanlab/actions/.github/actions/action-setup_task-installPyProject@main + uses: khanlab/actions/.github/actions/action-setup_task-installPyProject@maint/semver with: python-version: "3.10" - name: yamlfix @@ -33,7 +33,7 @@ jobs: python-version: ["3.8", "3.9", "3.10"] steps: - name: Setup Python environments - uses: khanlab/actions/.github/actions/action-setup_task-installPyProject@main + uses: khanlab/actions/.github/actions/action-setup_task-installPyProject@maint/semver with: python-version: ${{ matrix.python-version }} - name: Test minimum inputs