-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ops: enable building on x-calib-nopeak-find
- Loading branch information
1 parent
5b618df
commit dcd96ed
Showing
2 changed files
with
32 additions
and
23 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 |
---|---|---|
|
@@ -6,10 +6,13 @@ on: # yamllint disable-line rule:truthy | |
branches: | ||
- main | ||
- develop | ||
- x-calib-nopeak-find | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
tags: | ||
- v*.*.* | ||
workflow_dispatch: | ||
|
||
env: | ||
|
@@ -34,7 +37,7 @@ jobs: | |
steps: | ||
|
||
- name: Checkout the repository | ||
uses: actions/[email protected].6 | ||
uses: actions/[email protected].7 | ||
|
||
- name: Setup Python | ||
uses: actions/[email protected] | ||
|
@@ -74,17 +77,25 @@ jobs: | |
run: >- | ||
if [[ $GITHUB_REF == refs/heads/main ]]; then | ||
SKIP=no-commit-to-branch poetry run pre-commit run --all-files | ||
elif [[ $GITHUB_REF == refs/heads/x-calib-nopeak-find ]]; then | ||
echo 'Skipping pre-commit.' | ||
else | ||
poetry run pre-commit run --all-files | ||
fi | ||
- name: Run tests | ||
env: | ||
COVERAGE_FILE: .coverage.${{ matrix.python-version }} | ||
run: poetry run pytest --cov | ||
run: >- | ||
if [[ $GITHUB_REF == refs/heads/x-calib-nopeak-find ]]; then | ||
echo 'Skipping tests.' | ||
else | ||
poetry run pytest --cov | ||
fi | ||
- name: Store the coverage report | ||
uses: actions/[email protected] | ||
if: github.ref != 'refs/heads/x-calib-nopeak-find' | ||
with: | ||
name: coverage-${{ matrix.python-version }} | ||
path: .coverage.${{ matrix.python-version }} | ||
|
@@ -93,6 +104,7 @@ jobs: | |
|
||
runs-on: ubuntu-latest | ||
needs: test | ||
if: github.ref != 'refs/heads/x-calib-nopeak-find' | ||
permissions: | ||
pull-requests: write | ||
contents: write | ||
|
@@ -111,7 +123,7 @@ jobs: | |
|
||
- name: Process the coverage reports | ||
id: coverage_processing | ||
uses: py-cov-action/python-coverage-comment-action@v3.23 | ||
uses: py-cov-action/python-coverage-comment-action@v3.25 | ||
with: | ||
COVERAGE_DATA_BRANCH: 'COVERAGE-REPORT' | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
@@ -136,8 +148,9 @@ jobs: | |
id-token: write | ||
|
||
steps: | ||
|
||
- name: Checkout repository | ||
uses: actions/[email protected].6 | ||
uses: actions/[email protected].7 | ||
|
||
# Install the cosign tool except on PR | ||
# https://github.com/sigstore/cosign-installer | ||
|
@@ -168,8 +181,15 @@ jobs: | |
uses: docker/[email protected] | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
labels: | | ||
org.opencontainers.image.description=Spectra Search Interface | ||
org.opencontainers.image.licenses=MIT | ||
org.opencontainers.image.source=https://github.com/h2020charisma/spectrasearch | ||
org.opencontainers.image.title=spectra-search | ||
org.opencontainers.image.url=https://github.com/h2020charisma/spectrasearch/blob/main/README.md | ||
org.opencontainers.image.vendor=IDEAconsult | ||
tags: | | ||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/develop' }} | ||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/x-calib-nopeak-find' }} | ||
type=raw,value=stable,enable=${{ github.ref == 'refs/heads/main' }} | ||
type=ref,event=branch | ||
type=ref,event=tag | ||
|
@@ -179,14 +199,14 @@ jobs: | |
# https://github.com/docker/build-push-action | ||
- name: Build and push Docker image | ||
id: build-and-push | ||
uses: docker/build-push-action@v5.3.0 | ||
uses: docker/build-push-action@v6.2.0 | ||
with: | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
context: . | ||
labels: ${{ steps.meta.outputs.labels }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
# Sign the resulting Docker image digest except on PRs. | ||
# This will only write to the public Rekor transparency log when the Docker | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM python:3.12-slim as requirements-stage | ||
FROM python:3.12-slim AS requirements-stage | ||
|
||
WORKDIR /tmp | ||
|
||
|
@@ -10,17 +10,6 @@ RUN poetry export -f requirements.txt --output requirements.txt --without=dev -- | |
|
||
FROM python:3.12-slim | ||
|
||
LABEL maintainer="Luchesar ILIEV <[email protected]>" \ | ||
org.opencontainers.image.created=$BUILD_DATE \ | ||
org.opencontainers.image.description="A web-based spectra harmonization tool" \ | ||
org.opencontainers.image.revision=$VCS_REF \ | ||
org.opencontainers.image.schema-version="1.0" \ | ||
org.opencontainers.image.source="https://github.com/h2020charisma/spectrastream" \ | ||
org.opencontainers.image.title="spectrastream" \ | ||
org.opencontainers.image.url="https://github.com/h2020charisma/spectrastream/blob/main/README.md" \ | ||
org.opencontainers.image.vendor="IDEAconsult" \ | ||
org.opencontainers.image.version="latest" | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
curl \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
@@ -31,12 +20,12 @@ RUN sed -i 's/^-e //' /tmp/requirements.txt \ | |
&& pip install --no-cache-dir --upgrade -r /tmp/requirements.txt \ | ||
&& rm /tmp/requirements.txt | ||
|
||
COPY ./src/spectrastream /app | ||
COPY ./src /app | ||
|
||
WORKDIR /app | ||
|
||
EXPOSE 8501 | ||
|
||
HEALTHCHECK CMD curl --fail http://127.0.0.1:8501/_stcore/health | ||
|
||
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"] | ||
ENTRYPOINT ["streamlit", "run", "streamlit_app.py", "--server.address=0.0.0.0", "--server.port=8501", "--server.baseUrlPath=/stream"] |