Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	fuji_server/controllers/fair_check.py
#	fuji_server/evaluators/fair_evaluator_minimal_metadata.py
#	fuji_server/evaluators/fair_evaluator_searchable.py
#	fuji_server/harvester/metadata_harvester.py
  • Loading branch information
huberrob committed Sep 28, 2023
2 parents 73623a1 + 2db47f8 commit 4348d30
Show file tree
Hide file tree
Showing 160 changed files with 134,317 additions and 36,398 deletions.
11 changes: 9 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
directory: /
schedule:
interval: monthly
- package-ecosystem: pip
directory: /
schedule:
interval: monthly
- package-ecosystem: docker
directory: /
schedule:
interval: monthly
target-branch: master
61 changes: 38 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
# docs:
# runs-on: ubuntu-22.04
# steps:
# - uses: actions/checkout@v3
# - uses: actions/checkout@v4
# - name: Set up Python 3.11
# uses: actions/setup-python@v4
# with:
Expand All @@ -50,16 +50,16 @@ jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache python dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.cache/pre-commit
key: pip-lint-${{ hashFiles('.pre-commit-config.yaml', 'pyproject.toml') }}
key: lint-${{ hashFiles('.pre-commit-config.yaml', 'pyproject.toml') }}
restore-keys: |
pip-lint-
lint-
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
Expand All @@ -71,30 +71,45 @@ jobs:

tests:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ['3.11']
steps:
- uses: actions/checkout@v3
- name: Cache python dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-tests-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
pip-tests-${{ matrix.python-version }}-
- name: Set up Python ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: '3.11'
cache: pip
- name: Install python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install hatch
# TODO: remove, once dependencies are updated
- run: hatch run python -m pip list
- run: hatch run python -m pip list --outdated
python -m pip install --upgrade hatch
- name: Run test suite with coverage
run: hatch run cov
run: hatch run cov-ci

- name: Upload coverage reports
uses: actions/upload-artifact@v3
with:
name: coverage
retention-days: 1
path: |
junit.xml
pytest-coverage.txt
coverage:
runs-on: ubuntu-22.04
needs: tests
permissions:
contents: read
pull-requests: write
steps:
- name: Download coverage reports
uses: actions/download-artifact@v3
with:
name: coverage
# Ref: https://github.com/MishaKav/pytest-coverage-comment
- name: Add coverage comment
uses: MishaKav/[email protected]
with:
title: Coverage
pytest-coverage-path: pytest-coverage.txt
junitxml-path: junit.xml
48 changes: 24 additions & 24 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
- master
# Publish `v1.2.3` tags as releases?
# tags:
# - v*
release:
types:
- created
- created

env:
DOCKER_BUILDKIT: 1
Expand All @@ -25,35 +25,35 @@ jobs:

steps:

- run: docker --version
- run: docker buildx version
- run: docker --version
- run: docker buildx version

- uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME
- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME

- name: Log into GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
- name: Log into GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push image to GitHub Container Registry
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
- name: Push image to GitHub Container Registry
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ nosetests.xml
coverage.xml
*,cover
.hypothesis/
junit.xml
pytest-coverage.txt

# Translations
*.mo
Expand Down Expand Up @@ -184,3 +186,6 @@ Temporary Items
*.el
# # Jetbrains PyCharm Project folder:
.idea/

# Ruff
.ruff_cache
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ repos:
rev: v4.4.0
hooks:
- id: end-of-file-fixer
exclude_types: [json, text]
- id: mixed-line-ending
types: [python]
- id: trailing-whitespace
Expand All @@ -12,6 +11,8 @@ repos:
- id: check-json
- id: pretty-format-json
args: [--autofix]
- id: file-contents-sorter
files: ^fuji_server\/data\/.*.txt$
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.10.0
hooks:
Expand Down
16 changes: 8 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
version: "3.3"
version: '3.3'
services:
fujirest:
image: "ghcr.io/pangaea-data-publisher/fuji:latest"
image: ghcr.io/pangaea-data-publisher/fuji:latest
ports:
- "1071:1071"
- 1071:1071
environment:
- ENABLE_CORS=true
- ENABLE_CORS=true

notebook:
image: "jupyter/minimal-notebook:latest"
image: jupyter/minimal-notebook:latest
environment:
- JUPYTER_ENABLE_LAB=yes
- JUPYTER_ENABLE_LAB=yes
volumes:
- .:/home/jovyan/work
- .:/home/jovyan/work
ports:
- "8888:8888"
- 8888:8888
Loading

0 comments on commit 4348d30

Please sign in to comment.