Skip to content

build: install hatch to dependency-coversion build #57

build: install hatch to dependency-coversion build

build: install hatch to dependency-coversion build #57

Workflow file for this run

name: 'linting and testing'
on:
pull_request:
types:
- opened
- synchronize
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
which-paths:
runs-on: ubuntu-latest
outputs:
HATCH_VCS_TUNABLE_DIFF: ${{ steps.hatch-vcs-tunable-diff.outputs.HATCH_VCS_TUNABLE_DIFF }}
HATCH_DEPENDENCY_COVERSION_DIFF: ${{ steps.hatch-dependency-coversion-diff.outputs.HATCH_DEPENDENCY_COVERSION_DIFF }}
MANAGEMENT_DIFF: ${{ steps.management-diff.outputs.MANAGEMENT_DIFF }}
steps:
- name: Fetch repo for diffing
uses: actions/checkout@v3
- name: Check if vcs-tunable-analysis changed
uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
hatch-vcs-tunable/**/*
hatch-vcs-tunable/**/.*
FILES: |
.github/workflows/pull-request.yml
- name: Set diff output for hatch-vcs-tunable
id: hatch-vcs-tunable-diff
run: |
echo "HATCH_VCS_TUNABLE_DIFF=\"$(echo ${GIT_DIFF_FILTERED} | sed 's/ *$//')\"" >> $GITHUB_OUTPUT
- name: Check if dependency-coversion-analysis changed
uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
hatch-dependency-coversion/**/*
hatch-dependency-coversion/**/.*
FILES: |
.github/workflows/pull-request.yml
- name: Set diff output for hatch-dependency-coversion
id: hatch-dependency-coversion-diff
run: |
echo "HATCH_DEPENDENCY_COVERSION_DIFF=\"$(echo ${GIT_DIFF_FILTERED} | sed 's/ *$//')\"" >> $GITHUB_OUTPUT
- name: Check if repo management changed
uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/*
.*
.*/**/*
!hatch-vcs-tunable/**/*
!hatch-dependency-coversion/**/*
- name: Set diff output for management
id: management-diff
run: |
echo "MANAGEMENT_DIFF=\"$(echo ${GIT_DIFF_FILTERED} | set 's/ *$//')\"" >> $GITHUB_OUTPUT
hatch-vcs-tunable-analysis:
if: ${{ needs.which-paths.outputs.HATCH_VCS_TUNABLE_DIFF != '""' }}
runs-on: ubuntu-latest
needs: [which-paths]
steps:
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Set up python environment
run: |
python -m pip install pipx
pipx install hatch
- name: Fetch repo
uses: actions/checkout@v3
- name: Create default env
run: hatch env create default
working-directory: hatch-vcs-tunable
- name: Check formatting
run: hatch run format --check
working-directory: hatch-vcs-tunable
- name: Lint
run: hatch run lint
working-directory: hatch-vcs-tunable
- name: Check types
run: hatch run check
working-directory: hatch-vcs-tunable
- name: Quick tests
run: hatch run test
working-directory: hatch-vcs-tunable
hatch-vcs-tunable-tests:
if: ${{ needs.which-paths.outputs.HATCH_VCS_TUNABLE_DIFF != '""' }}
needs: [which-paths, hatch-vcs-tunable-analysis]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Set up python environment
run: |
python -m pip install pipx
pipx install hatch
- name: Fetch repo
uses: actions/checkout@v3
- name: Create test env
run: hatch env create test
working-directory: hatch-vcs-tunable
- name: Run all tests
run: hatch run test:test
working-directory: hatch-vcs-tunable
hatch-dependency-coversion-analysis:
if: ${{ needs.which-paths.outputs.HATCH_DEPENDENCY_COVERSION_DIFF != '""' }}
runs-on: ubuntu-latest
needs: [which-paths]
steps:
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Set up python environment
run: |
python -m pip install pipx
pipx install hatch
- name: Fetch repo
uses: actions/checkout@v3
- name: Create default env
run: hatch env create default
working-directory: hatch-dependency-coversion
- name: Check formatting
run: hatch run format --check
working-directory: hatch-dependency-coversion
- name: Lint
run: hatch run lint
working-directory: hatch-dependency-coversion
- name: Check types
run: hatch run check
working-directory: hatch-dependency-coversion
- name: Quick tests
run: hatch run test
working-directory: hatch-dependency-coversion
hatch-dependency-coversion-tests:
if: ${{ needs.which-paths.outputs.HATCH_DEPENDENCY_COVERSION_DIFF != '""' }}
needs: [which-paths, hatch-dependency-coversion-analysis]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Set up python environment
run: |
python -m pip install pipx
pipx install hatch
- name: Fetch repo
uses: actions/checkout@v3
- name: Create test env
run: hatch env create test
working-directory: hatch-dependency-coversion
- name: Run all tests
run: hatch run test:test
working-directory: hatch-dependency-coversion