|
8 | 8 | - ./github/* |
9 | 9 | jobs: |
10 | 10 | 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 |
78 | 13 |
|
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 |
94 | 14 |
|
95 | 15 | build: |
96 | 16 | needs: test |
|
0 commit comments