Skip to content

Commit

Permalink
CI: switch to centralized workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Samk13 committed Oct 30, 2024
1 parent b335bf6 commit 9f23859
Showing 1 changed file with 10 additions and 64 deletions.
74 changes: 10 additions & 64 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ name: CI

on:
push:
branches: master
branches:
- master
pull_request:
branches:
- master
Expand All @@ -26,66 +27,11 @@ on:
default: "Manual trigger"

jobs:
Tests:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version: [3.9, 3.12]
db-service: [postgresql14]
search-service: [opensearch2]
node-version: [18.x, 20.x]
include:
- db-service: postgresql14
DB_EXTRAS: "postgresql"

- search-service: opensearch2
SEARCH_EXTRAS: "opensearch2"

env:
DB: ${{ matrix.db-service }}
SEARCH: ${{ matrix.search-service }}
EXTRAS: tests,${{ matrix.SEARCH_EXTRAS }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.cfg

- name: Install dependencies
run: |
pip install ".[$EXTRAS]"
pip freeze
docker version
- name: Run backend tests
run: ./run-tests.sh

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Run eslint test
run: ./run-js-linter.sh -i

- name: Run translations test
run: ./run-i18n-tests.sh

- name: Install deps for frontend tests
working-directory: ./invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records
run: npm install

- name: Install deps for frontend tests - translations
working-directory: ./invenio_rdm_records/assets/semantic-ui/translations/invenio_rdm_records
run: npm install

- name: Run frontend tests
working-directory: ./invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records
run: npm test
Python:
uses: inveniosoftware/workflows/.github/workflows/tests-python.yml@master

JS:
uses: inveniosoftware/workflows/.github/workflows/tests-js.yml@master
with:
js-working-directory: ./invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records
translations-working-directory: ./invenio_rdm_records/assets/semantic-ui/translations/invenio_rdm_records

0 comments on commit 9f23859

Please sign in to comment.