Skip to content

Commit 9d17481

Browse files
authored
Merge pull request #495 from ror-community/dev
2 parents 0515c6e + e317337 commit 9d17481

4 files changed

Lines changed: 18 additions & 221 deletions

File tree

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
# Raise pull requests for version updates
8+
# to pip against the `dev` branch
9+
target-branch: "dev"
10+
# Labels on pull requests for version updates only
11+
labels:
12+
- "pip dependencies"

.github/workflows/dev.yml

Lines changed: 2 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -8,89 +8,9 @@ on:
88
- ./github/*
99
jobs:
1010
test:
11-
runs-on: ubuntu-latest
12-
env:
13-
ELASTIC7_HOST: "localhost"
14-
ELASTIC7_PORT: "9200"
15-
ELASTIC_PASSWORD: "changeme"
16-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
17-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
18-
AWS_REGION: ${{ secrets.AWS_REGION }}
19-
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
20-
LAUNCH_DARKLY_KEY: ${{ secrets.LAUNCH_DARKLY_KEY_DEV }}
21-
DB_HOST: 127.0.0.1 # Will not work with 'localhost', since that will try a Unix socket connection (!)
22-
services:
23-
elasticsearch7:
24-
image: docker.elastic.co/elasticsearch/elasticsearch:7.10.0
25-
env:
26-
discovery.type: single-node
27-
ES_JAVA_OPTS: -Xms512m -Xmx512m
28-
ELASTIC_PASSWORD: changeme
29-
xpack.security.enabled: "false"
30-
http.cors.enabled: "true"
31-
http.cors.allow-origin: "*"
32-
ports:
33-
- 9200:9200
34-
db:
35-
image: mysql:8.0
36-
env:
37-
MYSQL_DATABASE: "rorapi"
38-
MYSQL_USER: "ror_user"
39-
MYSQL_PASSWORD: "password"
40-
MYSQL_ROOT_PASSWORD: "password"
41-
ports:
42-
- 3306:3306
43-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
44-
steps:
45-
- name: Checkout ror-api code
46-
uses: actions/checkout@v2
47-
with:
48-
path: ror-api
49-
- name: Checkout ror-data-test
50-
uses: actions/checkout@v2
51-
with:
52-
repository: ror-community/ror-data-test
53-
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
54-
path: ror-data-test
55-
- name: Get last data dump name
56-
working-directory: ./ror-data-test
57-
run: |
58-
FILE="$(ls -Art *.zip | tail -n 1)"
59-
echo ${FILE%.*}
60-
echo "LATEST_DUMP_FILE=${FILE%.*}" >> $GITHUB_ENV
61-
- name: Cache dependency
62-
uses: actions/cache@v4
63-
with:
64-
path: ~/.cache/pip
65-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
66-
restore-keys: |
67-
${{ runner.os }}-pip-
68-
- name: Set up Python environment
69-
uses: actions/setup-python@v2
70-
with:
71-
python-version: "3.8"
72-
- name: Install requirements
73-
working-directory: ./ror-api
74-
run: |
75-
python -m pip install --upgrade pip
76-
pip install -r requirements.txt
77-
pip install yapf
11+
uses: ./.github/workflows/run_tests.yml
12+
secrets: inherit
7813

79-
python manage.py collectstatic --noinput
80-
- name: Setup
81-
working-directory: ./ror-api
82-
run: |
83-
python manage.py setup v1.55-2024-10-31-ror-data -t
84-
# Dump file temp hard coded for v2.1 release
85-
# Pulled from ror-data-test per settings.py config
86-
- name: Test
87-
working-directory: ./ror-api
88-
run: |
89-
python manage.py test rorapi.tests.tests_unit
90-
# python manage.py test rorapi.tests.tests_affiliations
91-
# TODO fix these tests running in GitHub Action
92-
# python manage.py test rorapi.tests_integration
93-
# python manage.py test rorapi.tests_functional
9414

9515
build:
9616
needs: test

.github/workflows/release.yml

Lines changed: 2 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -4,76 +4,8 @@ on:
44
types: [published]
55
jobs:
66
test:
7-
runs-on: ubuntu-latest
8-
env:
9-
ELASTIC_PASSWORD: "changeme"
10-
ELASTIC7_HOST: "localhost"
11-
ELASTIC7_PORT: "9200"
12-
DB_HOST: 127.0.0.1
13-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
14-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
15-
AWS_REGION: ${{ secrets.AWS_REGION }}
16-
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
17-
LAUNCH_DARKLY_KEY: ${{ secrets.LAUNCH_DARKLY_KEY_PROD}}
18-
services:
19-
elasticsearch7:
20-
image: docker.elastic.co/elasticsearch/elasticsearch:7.10.0
21-
env:
22-
discovery.type: single-node
23-
ES_JAVA_OPTS: -Xms512m -Xmx512m
24-
ELASTIC_PASSWORD: changeme
25-
xpack.security.enabled: "false"
26-
http.cors.enabled: "true"
27-
http.cors.allow-origin: "*"
28-
ports:
29-
- 9200:9200
30-
db:
31-
image: mysql:8.0
32-
env:
33-
MYSQL_DATABASE: "rorapi"
34-
MYSQL_USER: "ror_user"
35-
MYSQL_PASSWORD: "password"
36-
MYSQL_ROOT_PASSWORD: "password"
37-
ports:
38-
- 3306:3306
39-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
40-
steps:
41-
- name: Checkout ror-api code
42-
uses: actions/checkout@v2
43-
with:
44-
path: ror-api
45-
- name: Cache dependency
46-
uses: actions/cache@v4
47-
with:
48-
path: ~/.cache/pip
49-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
50-
restore-keys: |
51-
${{ runner.os }}-pip-
52-
- name: Set up Python environment
53-
uses: actions/setup-python@v2
54-
with:
55-
python-version: "3.8"
56-
- name: Install requirements
57-
working-directory: ./ror-api
58-
run: |
59-
python -m pip install --upgrade pip
60-
pip install -r requirements.txt
61-
pip install yapf
62-
63-
python manage.py collectstatic --noinput
64-
- name: Setup
65-
working-directory: ./ror-api
66-
run: |
67-
python manage.py setup v1.55-2024-10-31-ror-data -t
68-
# temp hard-coded dump file for v2.1 release
69-
- name: Test
70-
working-directory: ./ror-api
71-
run: |
72-
python manage.py test rorapi.tests.tests_unit
73-
# TODO fix these tests running in GitHub Action
74-
# python manage.py test rorapi.tests_integration
75-
# python manage.py test rorapi.tests_functional
76-
7+
uses: ./.github/workflows/run_tests.yml
8+
secrets: inherit
779
build:
7810
needs: test
7911
runs-on: ubuntu-latest

.github/workflows/staging.yml

Lines changed: 2 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -5,75 +5,8 @@ on:
55
- "staging"
66
jobs:
77
test:
8-
runs-on: ubuntu-latest
9-
env:
10-
ELASTIC_PASSWORD: "changeme"
11-
ELASTIC7_HOST: "localhost"
12-
ELASTIC7_PORT: "9200"
13-
DB_HOST: 127.0.0.1
14-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
15-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
16-
AWS_REGION: ${{ secrets.AWS_REGION }}
17-
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
18-
LAUNCH_DARKLY_KEY: ${{ secrets.LAUNCH_DARKLY_KEY_STAGING }}
19-
services:
20-
elasticsearch7:
21-
image: docker.elastic.co/elasticsearch/elasticsearch:7.10.0
22-
env:
23-
discovery.type: single-node
24-
ES_JAVA_OPTS: -Xms512m -Xmx512m
25-
ELASTIC_PASSWORD: changeme
26-
xpack.security.enabled: "false"
27-
http.cors.enabled: "true"
28-
http.cors.allow-origin: "*"
29-
ports:
30-
- 9200:9200
31-
db:
32-
image: mysql:8.0
33-
env:
34-
MYSQL_DATABASE: "rorapi"
35-
MYSQL_USER: "ror_user"
36-
MYSQL_PASSWORD: "password"
37-
MYSQL_ROOT_PASSWORD: "password"
38-
ports:
39-
- 3306:3306
40-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
41-
steps:
42-
- name: Checkout ror-api code
43-
uses: actions/checkout@v2
44-
with:
45-
path: ror-api
46-
- name: Cache dependency
47-
uses: actions/cache@v4
48-
with:
49-
path: ~/.cache/pip
50-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
51-
restore-keys: |
52-
${{ runner.os }}-pip-
53-
- name: Set up Python environment
54-
uses: actions/setup-python@v2
55-
with:
56-
python-version: "3.8"
57-
- name: Install requirements
58-
working-directory: ./ror-api
59-
run: |
60-
python -m pip install --upgrade pip
61-
pip install -r requirements.txt
62-
pip install yapf
63-
64-
python manage.py collectstatic --noinput
65-
- name: Setup
66-
working-directory: ./ror-api
67-
run: |
68-
python manage.py setup v1.55-2024-10-31-ror-data -t
69-
# temp hard-coded dump file for v2.1 release
70-
- name: Test
71-
working-directory: ./ror-api
72-
run: |
73-
python manage.py test rorapi.tests.tests_unit
74-
# TODO fix these tests running in GitHub Action
75-
# python manage.py test rorapi.tests_integration
76-
# python manage.py test rorapi.tests_functional
8+
uses: ./.github/workflows/run_tests.yml
9+
secrets: inherit
7710

7811
build:
7912
needs: test

0 commit comments

Comments
 (0)