Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
valentin-gauthier-geosiris committed Apr 3, 2024
1 parent 8074c0d commit ffe630b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:

jobs:
build:
working_directory: energyml-utils
name: Build distribution
runs-on: ubuntu-latest
steps:
Expand All @@ -23,13 +24,8 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Install poetry
uses: ../.github/actions/prepare-poetry
uses: .github/actions/prepare-poetry
with:
python-version: 3.9

Expand All @@ -45,43 +41,8 @@ jobs:
name: dist-artifact
path: dist/

test:
name: Test
needs: build
runs-on: ubuntu-latest
steps:

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get build artifacts
uses: actions/download-artifact@v3
with:
name: dist-artifact
path: dist/

- name: Install from build
run: |
python -m pip install --upgrade pip
pip install pytest-mock
pip install etpproto --pre --target=dist --find-links=dist/
- name: Copy tests and example data to dist folder for testing against artifacts
run: |
cp -R tests dist/
# cp -R example_data dist/

- name: Run tests
run: pytest dist/tests

publish:
working_directory: energyml-utils
name: Publish to PyPI
needs: [build, test]
runs-on: ubuntu-latest
Expand All @@ -100,7 +61,7 @@ jobs:
path: dist/

- name: Install poetry
uses: ../.github/actions/prepare-poetry
uses: .github/actions/prepare-poetry
with:
python-version: 3.9

Expand Down

0 comments on commit ffe630b

Please sign in to comment.