Skip to content

Commit

Permalink
Merge face04d into 9ac739e
Browse files Browse the repository at this point in the history
  • Loading branch information
chrabyrd authored Apr 3, 2024
2 parents 9ac739e + face04d commit 015d25e
Show file tree
Hide file tree
Showing 30 changed files with 1,653 additions and 766 deletions.
Binary file modified .coverage
Binary file not shown.
120 changes: 120 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: CI

on:
# push: -- just run on PRs for now
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgis/postgis:13-3.0
env:
POSTGRES_PASSWORD: postgis
POSTGRES_DB: arches_rdm_example_project
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
check-latest: true

- name: Install Java, GDAL, and other system dependencies
run: |
sudo apt update
sudo apt-get install libxml2-dev libpq-dev openjdk-8-jdk libgdal-dev libxslt-dev
echo Postgres and ES dependencies installed
- name: Install python packages
run: |
python -m pip install --upgrade pip
pip install .
pip install -r arches_rdm_example_project/install/requirements.txt
pip install -r arches_rdm_example_project/install/requirements_dev.txt
echo Python packages installed
- uses: ankane/setup-elasticsearch@v1
with:
elasticsearch-version: 8

- name: Check for missing migrations
run: |
python manage.py makemigrations --check
- name: Run unit tests
run: |
python -W default::DeprecationWarning -m coverage run manage.py test tests --pattern="*.py" --settings="tests.test_settings"
- name: Report coverage
run: |
coverage report
coverage json
- name: Upload coverage report as artifact
uses: actions/upload-artifact@v2
with:
name: coverage-report
path: |
coverage.json
.coverage
update-coverage:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Use the latest available version
check-latest: true

- name: Retrieve baseline coverage
run: |
git fetch origin main:main
baseline_coverage=$(git show main:coverage.json | grep -o '"totals": {[^}]*' | grep -o '"percent_covered": [0-9.]*' | awk -F ': ' '{print $2}')
echo "$baseline_coverage" > .coverage_baseline
- name: Download coverage report artifact
uses: actions/download-artifact@v2
with:
name: coverage-report
path: .

- name: Compare coverage with baseline
if: github.event_name == 'pull_request'
run: |
current_coverage=$(cat coverage.json | grep -o '"totals": {[^}]*' | grep -o '"percent_covered": [0-9.]*' | awk -F ': ' '{print $2}')
baseline_coverage=$(cat .coverage_baseline)
# Compare current coverage with baseline coverage using floating-point comparison
if awk -v current="$current_coverage" -v baseline="$baseline_coverage" 'BEGIN { exit (current < baseline) ? 0 : 1 }'; then
echo "Coverage decreased from $baseline_coverage% to $current_coverage%"
exit 1
else
echo "$baseline_coverage% = $current_coverage%, Coverage didn't decrease. Committing new .coverage and coverage.json."
git config user.name github-actions
git config user.email [email protected]
git add .coverage
git add coverage.json
git commit -m "automatically update .coverage and coverage.json"
git push -f origin HEAD:${{ github.event.pull_request.head.ref }}
fi
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
*.pyc
*.log
*.DS_Store
arches_rdm_example_project/logs
arches_rdm_example_project/export_deliverables
arches_rdm_example_project/cantaloupe/*
arches_rdm_example_project/staticfiles
arches_rdm_example_project/media/packages
arches_rdm_example_project/media/node_modules
arches_rdm_example_project/media/build/*
arches_rdm_example_project/media/build/
arches_rdm_example_project/uploadedfiles/*
arches_rdm_example_project/settings_local.py
arches_rdm_example_project/webpack/webpack-stats.json
arches_rdm_example_project/webpack/webpack-user-config.js
.vscode/
*.egg-info
.DS_STORE
CACHE
50 changes: 35 additions & 15 deletions arches_rdm_example_project/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
module.exports = {
"extends": [
"eslint:recommended"
"eslint:recommended",
'plugin:@typescript-eslint/recommended',
'plugin:vue/vue3-recommended',
],
"root": true,
"env": {
"browser": true,
"es6": true,
"node": true
},
"parser": "vue-eslint-parser",
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module",
"requireConfigFile": false
"requireConfigFile": false,
"parser": {
"ts": "@typescript-eslint/parser"
}
},
"globals": {
"define": false,
Expand All @@ -25,20 +32,33 @@ module.exports = {
"URLSearchParams": false,
"fetch": false
},
"ignorePatterns": [".eslintrc.js", "**/media/plugins/*"],
"rules": {
"semi": ["error", "always"],
"indent": ["error", 4],
"space-before-function-paren": ["error", "never"],
"no-extra-boolean-cast": 0, // 0=silence, 1=warning, 2=error
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-unused-vars': [1, {
argsIgnorePattern: '^_'
}],
"camelcase": [1, {"properties": "always"}],
}
},
"overrides": [
{
"files": [ "*.vue" ],
"rules": {
"vue/html-indent": [2, 4],
"vue/this-in-template": "off"
}
},
{
"files": [ "*.js" ],
"rules": {
"indent": ["error", 4],
"space-before-function-paren": ["error", "never"],
"no-extra-boolean-cast": 0, // 0=silence, 1=warning, 2=error
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-unused-vars': [1, {
argsIgnorePattern: '^_'
}],
"camelcase": [1, {"properties": "always"}],
}
}
]
};

43 changes: 43 additions & 0 deletions arches_rdm_example_project/gettext.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

module.exports = {
input: {
path: "./src", // only files in this directory are considered for extraction
include: ["**/*.vue"], // glob patterns to select files for extraction
exclude: [], // glob patterns to exclude files from extraction
jsExtractorOpts:[ // custom extractor keyword. default empty.
{
keyword: "__", // only extractor default keyword such as $gettext,use keyword to custom
options: { // see https://github.com/lukasgeiter/gettext-extractor
content: {
replaceNewLines: "\n",
},
arguments: {
text: 0,
},
},
},
{
keyword: "_n", // $ngettext
options: {
content: {
replaceNewLines: "\n",
},
arguments: {
text: 0,
textPlural: 1,
},
},
},
],
compileTemplate: false, // do not compile <template> tag when its lang is not html
},
output: {
path: "./locale", // output path of all created files
potPath: "./messages.pot", // relative to output.path, so by default "./src/language/messages.pot"
jsonPath: "./", // relative to output.path, so by default "./src/language/translations.json"
locales: ["en"],
flat: false, // don't create subdirectories for locales
linguas: false, // create a LINGUAS file
splitJson: true, // create separate json files for each locale. If used, jsonPath must end with a directory, not a file
},
};
2 changes: 1 addition & 1 deletion arches_rdm_example_project/install/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
arches~=7.5.0a1
arches~=7.5.0a1
5 changes: 5 additions & 0 deletions arches_rdm_example_project/install/requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
livereload
sst
coverage
sauceclient
django-silk==5.1.0
Empty file.
5 changes: 5 additions & 0 deletions arches_rdm_example_project/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"events": {
"start": "clear"
}
}
26 changes: 18 additions & 8 deletions arches_rdm_example_project/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
{
"name": "arches_rdm_example_project",
"license": "AGPL-3.0-only",
"scripts": {
"build_production": "./media/node_modules/.bin/cross-env NODE_PATH=./media/node_modules NODE_OPTIONS=--max-old-space-size=2048 NODE_ENV=production ./media/node_modules/.bin/webpack --config webpack/webpack.config.prod.js",
"build_development": "./media/node_modules/.bin/cross-env NODE_PATH=./media/node_modules NODE_OPTIONS=--max-old-space-size=2048 ./media/node_modules/.bin/webpack --config webpack/webpack.config.dev.js",
"build_test": "./media/node_modules/.bin/cross-env NODE_PATH=./media/node_modules NODE_OPTIONS=--max-old-space-size=2048 ./media/node_modules/.bin/webpack --config webpack/webpack.config.dev.js --env test=true",
"build_development": "yarn eslint:check && yarn typescript:check && ./media/node_modules/.bin/cross-env NODE_PATH=./media/node_modules NODE_OPTIONS=--max-old-space-size=2048 ./media/node_modules/.bin/webpack --config webpack/webpack.config.dev.js",
"build_production": "yarn eslint:check && yarn typescript:check && ./media/node_modules/.bin/cross-env NODE_PATH=./media/node_modules NODE_OPTIONS=--max-old-space-size=2048 NODE_ENV=production ./media/node_modules/.bin/webpack --config webpack/webpack.config.prod.js",
"build_test": "yarn eslint:check && yarn typescript:check && ./media/node_modules/.bin/cross-env NODE_PATH=./media/node_modules NODE_OPTIONS=--max-old-space-size=2048 ./media/node_modules/.bin/webpack --config webpack/webpack.config.dev.js --env test=true",
"eslint:check": "./media/node_modules/.bin/eslint ./src --resolve-plugins-relative-to ./media --ext .vue,.ts --parser ./media/node_modules/vue-eslint-parser/index.js",
"eslint:watch": "./media/node_modules/.bin/nodemon --watch ./src --ext ts,vue --exec yarn --silent eslint:check",
"gettext:extract": "./media/node_modules/.bin/vue-gettext-extract",
"gettext:compile": "./media/node_modules/.bin/vue-gettext-compile",
"typescript:check": "./media/node_modules/.bin/vue-tsc --noEmit",
"typescript:watch": "./media/node_modules/.bin/vue-tsc --watch --noEmit",
"start": "./media/node_modules/.bin/cross-env NODE_PATH=./media/node_modules NODE_OPTIONS=--max-old-space-size=2048 ./media/node_modules/.bin/webpack serve --config webpack/webpack.config.dev.js"
},
"devDependencies": {
"arches-dev-dependencies": "archesproject/arches-dev-dependencies#dev/7.5.x"
"arches-dev-dependencies": "archesproject/arches-dev-dependencies#dev/7.6.x"
},
"dependencies": {
"arches": "archesproject/arches#dev/7.5.x",
"arches_rdm": "archesproject/arches-rdm#main"
"arches": "archesproject/arches#dev/7.6.x",
"arches_rdm": "archesproject/arches-rdm"
},
"nodeModulesPaths": {}
}
"nodeModulesPaths": {},
"resolutions": {
"node-gyp": "^10.0.0"
}
}
Loading

0 comments on commit 015d25e

Please sign in to comment.