Skip to content
This repository was archived by the owner on Jul 5, 2023. It is now read-only.

Commit 2ddbf3c

Browse files
committed
Split setup process into different jobs on main workflow, capture venv on setup job and use it as output for the rest of workflows and jobs
1 parent 1a98491 commit 2ddbf3c

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

.github/workflows/main.yaml

+26-6
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,21 @@ on:
77
branches:
88
- main
99
workflow_call:
10+
outputs:
11+
venv:
12+
description: "Python virtual environment"
13+
value: ${{ jobs.setup.outputs.venv }}
1014
jobs:
11-
linting:
15+
setup:
16+
defaults:
17+
run:
18+
shell: bash
1219
strategy:
1320
matrix:
1421
os: [ubuntu-latest, windows-latest, macos-latest]
1522
python-version: ["3.7", "3.8", "3.9", "3.10"]
16-
defaults:
17-
run:
18-
shell: bash
23+
outputs:
24+
venv: ${{ steps.generate-outputs.outputs.venv }}
1925
runs-on: ${{ matrix.os }}
2026
steps:
2127
- name: Check out repository
@@ -24,12 +30,26 @@ jobs:
2430
uses: ./setup-action
2531
with:
2632
python-version: ${{ matrix.python-version }}
33+
- name: Generate outputs
34+
id: generate-outputs
35+
run: echo "venv=$VENV" >> $GITHUB_OUTPUT
36+
linting:
37+
defaults:
38+
run:
39+
shell: bash
40+
strategy:
41+
matrix:
42+
os: [ubuntu-latest, windows-latest, macos-latest]
43+
python-version: ["3.7", "3.8", "3.9", "3.10"]
44+
needs: setup
45+
runs-on: ${{ matrix.os }}
46+
steps:
2747
- name: Run Black
2848
run: |
29-
source $VENV
49+
source ${{ needs.setup.outputs.venv }}
3050
black --check boostbuild
3151
- name: Run Pylint
3252
run: |
33-
source $VENV
53+
source ${{ needs.setup.outputs.venv }}
3454
pylint --rcfile pyproject.toml boostbuild
3555

.github/workflows/publish.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ jobs:
1818
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
1919
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
2020
run: |
21-
source $VENV
21+
source ${{ needs.call-main.outputs.venv }}
2222
boost publish
2323

0 commit comments

Comments
 (0)