|
26 | 26 | ES_HOST_VOLUME: /opt/services/data/elasticsearch/data |
27 | 27 |
|
28 | 28 | jobs: |
29 | | - build: |
| 29 | + test: |
30 | 30 | runs-on: ubuntu-latest |
31 | 31 | timeout-minutes: 10 |
32 | 32 | concurrency: |
33 | | - group: ci-${{ github.ref }} |
| 33 | + group: ci-${{ github.event_name }}-${{ github.ref }} |
34 | 34 | cancel-in-progress: true |
35 | 35 |
|
36 | 36 | defaults: |
37 | 37 | run: |
38 | 38 | shell: bash -l {0} |
39 | 39 |
|
40 | 40 | steps: |
41 | | - - uses: actions/checkout@v3 |
42 | | - |
43 | | - - uses: mamba-org/setup-micromamba@v1 |
44 | | - with: |
45 | | - miniconda-version: "latest" |
46 | | - mamba-version: "*" |
47 | | - environment-file: conda/base.yaml |
48 | | - channels: conda-forge,nodefaults |
49 | | - channel-priority: true |
50 | | - activate-environment: es-journals |
51 | | - use-mamba: true |
52 | | - miniforge-variant: Mambaforge |
53 | | - |
54 | | - - name: Set Environment Variable |
55 | | - run: echo "GITHUB_PAT=${{ secrets.DEVTOOLS_PAT }}" >> $GITHUB_ENV |
56 | | - |
57 | | - - name: Create environment variables files |
58 | | - run: | |
59 | | - envsubst < .env.tpl > .env |
60 | | -
|
61 | | - - name: Check if poetry.lock is updated |
62 | | - run: poetry check |
63 | | - |
64 | | - - name: Install dependencies |
65 | | - run: poetry install --no-root |
66 | | - |
67 | | - - name: Clean-up |
68 | | - run: makim clean.tmp |
69 | | - |
70 | | - - name: Setup development environment for Rxivs |
71 | | - run: | |
72 | | - for rxiv_name in biorxiv medrxiv; do |
73 | | - makim develop.setup-dev-env --index-name $rxiv_name |
74 | | - done |
75 | | -
|
76 | | - - name: Start Elasticsearch |
77 | | - run: | |
78 | | - sugar compose-ext start --options "-d" |
79 | | -
|
80 | | - - name: Fetch and process MedRxiv data |
81 | | - run: | |
82 | | - bash scripts/fetch_rxivx_data.sh medrxiv |
83 | | -
|
84 | | - # - name: Count documents in MedRxiv index |
85 | | - # run: | |
86 | | - # makim develop.count-docs-in-index --index-name medrxiv |
87 | | - |
88 | | - |
89 | | - - name: Run tests |
90 | | - run: makim tests.unittest |
91 | | - |
92 | | - - name: Setup tmate session |
93 | | - if: "${{ failure() }}" |
94 | | - uses: mxschmitt/action-tmate@v3 |
| 41 | + - uses: actions/checkout@v4 |
| 42 | + |
| 43 | + - name: Cache Conda Packages |
| 44 | + uses: actions/cache@v3 |
| 45 | + with: |
| 46 | + path: ~/.conda/envs/es-journals |
| 47 | + key: ubuntu-latest-conda-${{ hashFiles('conda/base.yaml') }} |
| 48 | + restore-keys: | |
| 49 | + ubuntu-latest-conda- |
| 50 | +
|
| 51 | + - uses: conda-incubator/setup-miniconda@v3 |
| 52 | + with: |
| 53 | + miniforge-version: latest |
| 54 | + environment-file: conda/base.yaml |
| 55 | + channels: conda-forge,nodefaults |
| 56 | + activate-environment: es-journals |
| 57 | + auto-update-conda: true |
| 58 | + conda-solver: libmamba |
| 59 | + |
| 60 | + - name: Set Environment Variable |
| 61 | + run: echo "GITHUB_PAT=${{ secrets.DEVTOOLS_PAT }}" >> $GITHUB_ENV |
| 62 | + |
| 63 | + - name: Create environment variables files |
| 64 | + run: | |
| 65 | + envsubst < .env.tpl > .env |
| 66 | +
|
| 67 | + - name: Check if poetry.lock is updated |
| 68 | + run: poetry check |
| 69 | + |
| 70 | + - name: Install dependencies |
| 71 | + run: | |
| 72 | + poetry config virtualenvs.create false |
| 73 | + poetry install --no-root |
| 74 | +
|
| 75 | + - name: Clean-up |
| 76 | + run: makim clean.tmp |
| 77 | + |
| 78 | + - name: Setup development environment for Rxivs |
| 79 | + run: | |
| 80 | + for rxiv_name in biorxiv medrxiv; do |
| 81 | + makim develop.setup-dev-env --index-name $rxiv_name |
| 82 | + done |
| 83 | +
|
| 84 | + - name: Start Elasticsearch |
| 85 | + run: | |
| 86 | + sugar compose-ext start --options "-d" |
| 87 | +
|
| 88 | + - name: Fetch and process MedRxiv data |
| 89 | + run: | |
| 90 | + bash scripts/fetch_rxivx_data.sh medrxiv |
| 91 | +
|
| 92 | + # - name: Count documents in MedRxiv index |
| 93 | + # run: | |
| 94 | + # makim develop.count-docs-in-index --index-name medrxiv |
| 95 | + |
| 96 | + |
| 97 | + - name: Run tests |
| 98 | + run: makim tests.unittest |
| 99 | + |
| 100 | + - name: Setup tmate session |
| 101 | + if: "${{ failure() }}" |
| 102 | + uses: mxschmitt/action-tmate@v3 |
0 commit comments