Skip to content

Commit ea1cdb9

Browse files
authored
fix(actions): add datascience package to makefile and CI (#26)
1 parent 0990b5b commit ea1cdb9

File tree

5 files changed

+41
-17
lines changed

5 files changed

+41
-17
lines changed

.github/workflows/merge_main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ jobs:
3434

3535
- name: Count number or releases for tag
3636
id: build_number
37-
run: echo "::set-output name=value::$(($(git tag | grep -c ${{ steps.semantic.outputs.new_release_version }}) + 1))"
37+
run: echo "value=$(($(git tag | grep -c ${{ steps.semantic.outputs.new_release_version }}) + 1))" >> $GITHUB_OUTPUT
3838

3939
- name: Compute version
4040
id: version
41-
run: echo "::set-output name=value::${{ steps.semantic.outputs.new_release_version }}.rc${{ steps.build_number.outputs.value }}"
41+
run: echo "value=${{ steps.semantic.outputs.new_release_version }}.rc${{ steps.build_number.outputs.value }}" >> $GITHUB_OUTPUT
4242

4343

4444
prerelease:

.github/workflows/pull_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ jobs:
3434
steps:
3535
- uses: actions/checkout@v3
3636

37-
- name: Setup Python 3.8
37+
- name: Setup Python 3.10
3838
uses: actions/setup-python@v4
3939
with:
40-
python-version: '3.8'
40+
python-version: '3.10'
4141

4242
- name: Install dependencies
4343
run: |

.github/workflows/release.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,37 @@ jobs:
2020
steps:
2121
- name: Version
2222
id: version
23-
run: echo ::set-output name=value::${GITHUB_REF#refs/*/}
23+
run: echo "value=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
2424

2525

26-
build-upload:
27-
name: Build and Upload
26+
build-packages:
27+
name: Build ${{ matrix.package }} package
2828
runs-on: ubuntu-20.04
2929

30+
strategy:
31+
matrix:
32+
package: [core, datascience]
33+
3034
needs:
3135
- prepare
3236

3337
env:
34-
ROOT_DIR: src/core
38+
ROOT_DIR: src/${{ matrix.package }}
3539

3640
steps:
3741
- uses: actions/checkout@v3
3842

3943
- name: Setup Python
4044
uses: actions/setup-python@v4
4145
with:
42-
python-version: '3.8'
46+
python-version: '3.10'
4347

4448
- name: Install build dependencies
4549
run: python -m pip install --upgrade pip wheel
4650

4751
- name: Build
4852
run: |
49-
echo "${{ needs.prepare.outputs.version }}" > VERSION
50-
cd $ROOT_DIR && python setup.py bdist_wheel
53+
make build-${{ matrix.package }} version=${{ needs.prepare.outputs.version }} PYTHON=python
5154
5255
- name: Upload release assets
5356
uses: AButler/[email protected]
@@ -63,7 +66,6 @@ jobs:
6366
password: ${{ secrets.PYPI_API_TOKEN }}
6467
packages_dir: '${{ env.ROOT_DIR }}/dist/'
6568

66-
6769
# update-dockerfiles:
6870
# name: Create pull request to update dockerfiles
6971
# runs-on: ubuntu-20.04

Makefile

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ clean-pyc: ### Removes python compiled bytecode files
3636

3737

3838
define BUILD
39+
echo $(version) > VERSION && \
3940
cd src/$1/ && rm -rf dist/ && $(PYTHON) setup.py bdist_wheel
4041
endef
4142

@@ -47,15 +48,30 @@ define UPLOAD
4748
cd src/$1/ && $(PYTHON) -m twine upload -r ydata dist/*
4849
endef
4950

50-
build: ### Build package
51+
build-core:
5152
$(call BUILD,core)
5253

53-
upload: ### Upload build package into pypi
54+
build-datascience:
55+
$(call BUILD,datascience)
56+
57+
build-all: build-core build-datascience ### Build all packages
58+
59+
upload-core:
5460
$(call UPLOAD,core)
5561

56-
lint: ### Run prospector
62+
upload-datascience:
63+
$(call UPLOAD,datascience)
64+
65+
upload-all: upload-core upload-datascience ### Upload all packages to pypi
66+
67+
lint-core: ### Run prospector
5768
$(PYTHON) -m prospector src/core
5869

70+
lint-datascience: ### Run prospector
71+
$(PYTHON) -m prospector src/datascience
72+
73+
lint: lint-core lint-datascience ### Run prospector on all packages
74+
5975
define LINK_LOCAL
6076
$(PIP) install -e src/$1
6177
endef
@@ -64,5 +80,11 @@ link-core:
6480
echo "0.0.0" > src/core/VERSION
6581
$(call LINK_LOCAL,core)
6682

67-
test: link-core ### Runs the tests
83+
link-datascience:
84+
echo "0.0.0" > src/datascience/VERSION
85+
$(call LINK_LOCAL,datascience)
86+
87+
link-all: link-core link-datascience ### Link all packages
88+
89+
test: link-all ### Runs the tests
6890
$(PYTHON) -m pytest src/core

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.0
1+
0.3.0

0 commit comments

Comments
 (0)