-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create composite action for installing eitprocessing
- Loading branch information
Showing
6 changed files
with
74 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Install eitprocessing | ||
description: Install eitprocessing on the given Python version. | ||
inputs: | ||
python-version: | ||
description: "The Python version to use" | ||
required: false | ||
default: "3.10" | ||
dependencies: | ||
description: "The optional dependencies of eitprocessing to install" | ||
required: false | ||
extract-data: | ||
description: "Whether to extract testing data" | ||
required: false | ||
default: "false" | ||
token: | ||
description: "GitHub TOKEN" | ||
required: true | ||
data-directory: | ||
description: "Directory where to store eitprocessing data" | ||
required: false | ||
default: ${{ github.workspace }}/../eitprocessing_data/ | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
- uses: docker/[email protected] | ||
if: ${{ inputs.extract-data == "true" }} | ||
with: | ||
registry: ghcr.io | ||
username: psomhorst | ||
password: ${{ inputs.token }} | ||
- uses: shrink/actions-docker-extract@v3 | ||
if: ${{ inputs.extract-data == "true" }} | ||
with: | ||
image: ghcr.io/eit-alive/eittestdata:latest | ||
destination: ${{ inputs.data-directory }} | ||
path: /eitprocessing/. | ||
- name: Install eitprocessing with ${{ inputs.dependencies }} dependencies | ||
run: python3 -m pip install ".[${{ inputs.dependencies }}]" | ||
shell: bash | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,23 +29,13 @@ jobs: | |
EIT_PROCESSING_TEST_DATA: ${{ github.workspace }}/../eitprocessing_data/ | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
- uses: ./.github/actions/install_eitprocessing | ||
with: | ||
dependencies: testing | ||
extract-data: true | ||
python-version: ${{ matrix.python-version }} | ||
- name: Connect to Container Registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: psomhorst | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract data from image | ||
uses: shrink/actions-docker-extract@v3 | ||
with: | ||
image: ghcr.io/eit-alive/eittestdata:latest | ||
destination: $EIT_PROCESSING_TEST_DATA | ||
path: /eitprocessing/. | ||
- name: Install eitprocessing with testing dependencies | ||
run: python3 -m pip install ".[testing]" | ||
os: ${{ matrix.os }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
data-directory: ${{ env.EIT_PROCESSING_TEST_DATA }} | ||
- name: Run pytest | ||
run: pytest -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,24 +22,13 @@ jobs: | |
COVERALLS_FLAG_NAME: python-${{ matrix.python-version }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
- uses: ./.github/actions/install_eitprocessing | ||
with: | ||
dependencies: testing | ||
extract-data: true | ||
python-version: ${{ matrix.python-version }} | ||
- name: Connect to Container Registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: psomhorst | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract data from image | ||
uses: shrink/actions-docker-extract@v3 | ||
with: | ||
image: ghcr.io/eit-alive/eittestdata:latest | ||
destination: $EIT_PROCESSING_TEST_DATA | ||
path: /eitprocessing/. | ||
- name: Install eitprocessing | ||
run: python3 -m pip install ".[testing]" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
data-directory: ${{ env.EIT_PROCESSING_TEST_DATA }} | ||
- name: Run coveralls | ||
run: | | ||
pytest --cov --cov-report xml --cov-report term --cov-report html | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,28 +25,18 @@ jobs: | |
os: ["ubunt-latest"] | ||
python-version: ["3.10", "3.11", "3.12", "3.13"] | ||
name: Build for ${{ matrix.python-version }}, ${{ matrix.os }} | ||
env: | ||
EIT_PROCESSING_TEST_DATA: ${{ github.workspace }}/../eitprocessing_data/ | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Connect to container registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: psomhorst | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Connect to Container Registry | ||
uses: docker/[email protected] | ||
- uses: ./.github/actions/install_eitprocessing | ||
with: | ||
registry: ghcr.io | ||
username: psomhorst | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract data from image | ||
uses: shrink/actions-docker-extract@v3 | ||
with: | ||
image: ghcr.io/eit-alive/eittestdata:latest | ||
destination: $EIT_PROCESSING_TEST_DATA | ||
path: /eitprocessing/. | ||
- name: Install eitprocessing with testing dependecies | ||
run: python3 -m pip install ".[testing]" | ||
dependencies: testing | ||
extract-data: true | ||
python-version: ${{ matrix.python-version }} | ||
os: ${{ matrix.os }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
data-directory: ${{ env.EIT_PROCESSING_TEST_DATA }} | ||
- name: Run pytest | ||
run: pytest -v | ||
- name: Install eitprocessing with dev dependencies | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters