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

Commit 01fa2d5

Browse files
committed
Rework actions to remove errors when using multiple jobs/workflows and their outputs using matrix (#3)
1 parent e0d4f73 commit 01fa2d5

File tree

3 files changed

+8
-44
lines changed

3 files changed

+8
-44
lines changed

.github/workflows/main.yaml

+3-24
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- main
99
workflow_call:
1010
jobs:
11-
setup:
11+
linting:
1212
defaults:
1313
run:
1414
shell: bash
@@ -24,33 +24,12 @@ jobs:
2424
uses: ./setup-action
2525
with:
2626
python-version: ${{ matrix.python-version }}
27-
linting:
28-
defaults:
29-
run:
30-
shell: bash
31-
strategy:
32-
matrix:
33-
os: [ubuntu-latest, windows-latest, macos-latest]
34-
python-version: ["3.7", "3.8", "3.9", "3.10"]
35-
needs: setup
36-
runs-on: ${{ matrix.os }}
37-
steps:
38-
- name: Check out repository
39-
uses: actions/checkout@v3
40-
- name: Load cached venv
41-
id: cached-poetry-dependencies
42-
uses: actions/cache@v3
43-
with:
44-
path: .venv
45-
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
4627
- name: Run Black
4728
run: |
48-
source .venv/scripts/activate
29+
source $VENV
4930
black --check boostbuild
50-
if: runner.os == 'Windows'
5131
- name: Run Pylint
5232
run: |
53-
source .venv/bin/activate
33+
source $VENV
5434
pylint --rcfile pyproject.toml boostbuild
55-
if: runner.os != 'Windows'
5635

.github/workflows/publish.yaml

+4-19
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,15 @@ on:
44
tags:
55
- "v*.*.*"
66
jobs:
7-
call-main:
8-
uses: ./.github/workflows/main.yaml
97
publish:
10-
needs: call-main
11-
defaults:
12-
run:
13-
shell: bash
148
runs-on: ubuntu-latest
159
steps:
1610
- name: Check out repository
1711
uses: actions/checkout@v3
18-
- name: Install Poetry
19-
uses: snok/install-poetry@v1
20-
- name: Load cached venv
21-
id: cached-poetry-dependencies
22-
uses: actions/cache@v3
12+
- name: Setup project, python and poetry
13+
uses: ./setup-action
2314
with:
24-
path: .venv
25-
key: venv-${{ runner.os }}-3.10-${{ hashFiles('**/poetry.lock') }}
15+
python-version: ${{ matrix.python-version }}
2616
- name: Publish package to PyPi
27-
env:
28-
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
29-
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
30-
run: |
31-
source .venv/bin/activate
32-
boost publish
17+
run: poetry publish --build --username ${{ secrets.PYPI_USERNAME }} --password ${{ secrets.PYPI_PASSWORD }}
3318

setup-action/action.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ runs:
2222
uses: actions/cache@v3
2323
with:
2424
path: .venv
25-
key: venv-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
25+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
2626
- name: Install dependencies
2727
shell: bash
2828
run: poetry install --no-interaction --no-root

0 commit comments

Comments
 (0)