Skip to content

Commit

Permalink
add pre-job
Browse files Browse the repository at this point in the history
  • Loading branch information
ryannikolaidis committed Oct 4, 2023
1 parent 16f5908 commit 02ffcfc
Showing 1 changed file with 27 additions and 16 deletions.
43 changes: 27 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,18 @@ env:
GHA_CACHE_KEY_VERSION: "v1"

jobs:
pre-job:
runs-on: ubuntu-latest
outputs:
skip_no_code_changes: ${{ steps.has_code_changes.outputs.should_skip }}
steps:
- id: has_code_changes
uses: fkirc/skip-duplicate-actions@v5
with:
paths_ignore: '["unstructured/__version__.py", "CHANGELOG.py"]'
setup:
needs: pre-job
if: needs.pre-job.outputs.skip_no_code_changes == 'false'
strategy:
matrix:
python-version: ["3.8","3.9","3.10","3.11"]
Expand Down Expand Up @@ -50,8 +61,8 @@ jobs:
matrix:
python-version: ["3.8","3.9","3.10","3.11"]
runs-on: ubuntu-latest
needs: setup
if: needs.setup.outputs.skip_no_code_changes != 'true'
needs: [setup, pre-job]
if: needs.pre-job.outputs.skip_no_code_changes == 'false'
steps:
- uses: actions/checkout@v3
- uses: actions/cache/restore@v3
Expand Down Expand Up @@ -81,8 +92,8 @@ jobs:
matrix:
python-version: ["3.8","3.9","3.10","3.11"]
runs-on: ubuntu-latest
needs: setup
if: needs.setup.outputs.skip_no_code_changes != 'true'
needs: [setup, pre-job]
if: needs.pre-job.outputs.skip_no_code_changes == 'false'
steps:
- uses: actions/checkout@v3
- uses: actions/cache/restore@v3
Expand Down Expand Up @@ -121,8 +132,8 @@ jobs:
runs-on: ubuntu-latest
env:
NLTK_DATA: ${{ github.workspace }}/nltk_data
needs: [setup, lint]
if: needs.setup.outputs.skip_no_code_changes != 'true'
needs: [setup, pre-job, lint]
if: needs.pre-job.outputs.skip_no_code_changes == 'false'
steps:
- uses: actions/checkout@v3
- uses: actions/cache/restore@v3
Expand Down Expand Up @@ -166,8 +177,8 @@ jobs:
runs-on: ubuntu-latest
env:
NLTK_DATA: ${{ github.workspace }}/nltk_data
needs: [setup, lint]
if: needs.setup.outputs.skip_no_code_changes != 'true'
needs: [setup, pre-job, lint]
if: needs.pre-job.outputs.skip_no_code_changes == 'false'
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -204,8 +215,8 @@ jobs:
runs-on: ubuntu-latest
env:
NLTK_DATA: ${{ github.workspace }}/nltk_data
needs: [setup, lint, test_unit_no_extras]
if: needs.setup.outputs.skip_no_code_changes != 'true'
needs: [setup, pre-job, lint, test_unit_no_extras]
if: needs.pre-job.outputs.skip_no_code_changes == 'false'
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -245,8 +256,8 @@ jobs:
runs-on: ubuntu-latest-m
env:
NLTK_DATA: ${{ github.workspace }}/nltk_data
needs: [setup, lint]
if: needs.setup.outputs.skip_no_code_changes != 'true'
needs: [setup, pre-job, lint]
if: needs.pre-job.outputs.skip_no_code_changes == 'false'
steps:
- uses: actions/checkout@v3
- uses: actions/cache/restore@v3
Expand Down Expand Up @@ -349,8 +360,8 @@ jobs:
runs-on: ubuntu-latest
env:
NLTK_DATA: ${{ github.workspace }}/nltk_data
needs: [setup, lint]
if: needs.setup.outputs.skip_no_code_changes != 'true'
needs: [setup, pre-job, lint]
if: needs.pre-job.outputs.skip_no_code_changes == 'false'
steps:
- uses: actions/checkout@v3
- uses: actions/cache/restore@v3
Expand Down Expand Up @@ -409,8 +420,8 @@ jobs:
# (Using the virtualenv to get pytest)
test_dockerfile:
runs-on: ubuntu-latest
needs: [ setup, lint ]
if: needs.setup.outputs.skip_no_code_changes != 'true'
needs: [setup, pre-job, lint]
if: needs.pre-job.outputs.skip_no_code_changes == 'false'
steps:
- uses: actions/checkout@v3
- uses: actions/cache/restore@v3
Expand Down

0 comments on commit 02ffcfc

Please sign in to comment.