Skip to content

Commit a34c68f

Browse files
committed
wip: fix docker build
0 parents  commit a34c68f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+23188
-0
lines changed

.babelrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env"
5+
]
6+
]
7+
}

.browserslistrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[production staging]
2+
>5%
3+
last 2 versions
4+
Firefox ESR
5+
not ie < 11
6+
7+
[development]
8+
last 1 chrome version
9+
last 1 firefox version
10+
last 1 edge version

.coveragerc

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[run]
2+
source =
3+
arches_perm_demo/
4+
5+
omit =
6+
*/python?.?/*
7+
*/migrations/*
8+
*/settings*.py
9+
*/urls.py
10+
*/wsgi.py
11+
*/hosts.py
12+
*/celery.py
13+
*/__init__.py
14+
15+
data_file = coverage/python/.coverage
16+
17+
[report]
18+
show_missing = true
19+
20+
exclude_lines =
21+
pragma: no cover
22+
23+
[html]
24+
directory = coverage/python/htmlcov
25+
26+
[xml]
27+
output = coverage/python/coverage.xml
28+
29+
[json]
30+
output = coverage/python/coverage.json

.gitattributes

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text=auto
3+
4+
# Known binary formats
5+
*.png binary
6+
*.jpg binary
7+
*.ico binary
8+
*.gif binary
9+
*.ttf binary
10+
*.woff binary
11+
*.woff2 binary
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: 'Build and test branch'
2+
description: 'Builds and tests a branch'
3+
inputs:
4+
branch-type:
5+
description: 'String denoting either `target` or `feature` branch'
6+
required: true
7+
project-name:
8+
description: 'String denoting the name of the project'
9+
required: true
10+
secrets:
11+
description: 'Secrets from main.yml as JSON'
12+
runs:
13+
using: 'composite'
14+
steps:
15+
- name: Install Java, GDAL, and other system dependencies
16+
run: |
17+
sudo apt update
18+
sudo apt-get install libxml2-dev libpq-dev openjdk-8-jdk libgdal-dev libxslt-dev
19+
echo Postgres and ES dependencies installed
20+
shell: bash
21+
22+
- name: Set up Elasticsearch
23+
uses: ankane/setup-elasticsearch@v1
24+
with:
25+
elasticsearch-version: 8
26+
27+
- name: Install Python packages
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install '.[dev]'
31+
echo Python packages installed
32+
shell: bash
33+
34+
- name: Ensure frontend configuration files exist
35+
run: |
36+
python manage.py check
37+
shell: bash
38+
39+
- name: Install Arches applications
40+
uses: ./.github/actions/install-arches-applications
41+
with:
42+
secrets: ${{ inputs.secrets }}
43+
44+
- name: Install frontend dependencies
45+
run: |
46+
npm install
47+
shell: bash
48+
49+
- name: Webpack frontend files
50+
run: |
51+
npm run build_test
52+
shell: bash
53+
54+
- name: Check frontend formatting with prettier
55+
run: |
56+
npm run prettier:check
57+
shell: bash
58+
59+
- name: Check backend formatting with black
60+
run: |
61+
black . --check --exclude=node_modules
62+
shell: bash
63+
64+
- name: Check line endings on all but ontology (.xml) files
65+
run: |
66+
! git ls-files --eol | grep -v '.xml' | grep 'w/crlf\|w/mixed'
67+
shell: bash
68+
69+
- name: Run frontend tests
70+
run: |
71+
npm run vitest
72+
mv coverage/frontend/coverage.xml ${{ inputs.branch-type }}_branch_frontend_coverage.xml
73+
shell: bash
74+
75+
- name: Check for missing migrations
76+
run: |
77+
python manage.py makemigrations --check
78+
shell: bash
79+
80+
- name: Ensure previous Python coverage data is erased
81+
run: |
82+
coverage erase
83+
shell: bash
84+
85+
- name: Run Python unit tests
86+
run: |
87+
python -W default::DeprecationWarning -m coverage run manage.py test tests --settings="tests.test_settings"
88+
shell: bash
89+
90+
- name: Generate Python report coverage
91+
run: |
92+
coverage report
93+
coverage json
94+
mv coverage/python/coverage.json ${{ inputs.branch-type }}_branch_python_coverage.json
95+
shell: bash
96+
97+
- name: Upload frontend coverage report as artifact
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: ${{ inputs.branch-type }}-branch-frontend-coverage-report
101+
path: ${{ inputs.branch-type }}_branch_frontend_coverage.xml
102+
overwrite: true
103+
104+
- name: Upload Python coverage report as artifact
105+
uses: actions/upload-artifact@v4
106+
with:
107+
name: ${{ inputs.branch-type }}-branch-python-coverage-report
108+
path: ${{ inputs.branch-type }}_branch_python_coverage.json
109+
overwrite: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: 'Install Arches Applications'
2+
description: 'Manually edit this file to install all Arches Applications declared in settings.py, but not declared in `pyproject.toml`'
3+
inputs:
4+
secrets:
5+
description: 'Secrets from main.yml as JSON'
6+
runs:
7+
using: 'composite'
8+
steps:
9+
10+
# Manually add any ARCHES_APPLICATIONS to this file if not already declared in `pyproject.toml`.
11+
# Below is a template for adding an application in a private repository.
12+
# Be sure to delete the `no-op step` if adding when updating this file.
13+
14+
- name: No-op step to maintain workflow structure
15+
run: echo "No-op step"
16+
shell: bash
17+
18+
# - name: Checkout ${my_arches_application_name}
19+
# uses: actions/checkout@v4
20+
# with:
21+
# repository: ${my_arches_application_repository}/${my_arches_application_name}
22+
# token: ${{ fromJSON(inputs.secrets).${my_github_personal_access_token} }}
23+
# path: ${my_arches_application_name}
24+
25+
# - name: Install ${my_arches_application_name}
26+
# run: |
27+
# pip install ./${my_arches_application_name}
28+
# echo ${my_arches_application_name} installed
29+
# shell: bash

0 commit comments

Comments
 (0)