Skip to content

Commit

Permalink
Start using Node.js v22 inside container
Browse files Browse the repository at this point in the history
upgrade from v16

Note: fixes indentation in YAML files
  • Loading branch information
atodorov committed Jan 5, 2025
1 parent 3a6d808 commit 5b83c51
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 61 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/coverity_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ jobs:
with:
python-version: 3.11

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install depenencies
run: |
sudo apt-get update
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Run eslint
run: |
cd tcms/
Expand Down
73 changes: 43 additions & 30 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,25 @@ jobs:
python-version: [3.11]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: test-for-missing-migrations
run: |
pip install -r requirements/devel.txt
pushd tcms/ && ./npm-install && popd
- uses: actions/checkout@v4

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

export LANG=en-us
make test_for_missing_migrations
- name: test-for-missing-migrations
run: |
pip install -r requirements/devel.txt
pushd tcms/ && ./npm-install && popd
export LANG=en-us
make test_for_missing_migrations
test-migrations-rollback:
runs-on: ubuntu-latest
Expand All @@ -53,24 +60,30 @@ jobs:
python-version: [3.11]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4

- name: Create database
run: |
docker compose -f docker-compose.postgres pull db
docker compose -f docker-compose.postgres run -d -p 5432:5432 --name kiwi_db db
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: migrations rollback
run: |
pip install -r requirements/devel.txt
pip install -r requirements/postgres.txt
pushd tcms/ && ./npm-install && popd
export LANG=en-us
# Postgres b/c it has best support for schema altering operations
export DJANGO_SETTINGS_MODULE=tcms.settings.test.postgresql
./tests/migrations-rollback
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Create database
run: |
docker compose -f docker-compose.postgres pull db
docker compose -f docker-compose.postgres run -d -p 5432:5432 --name kiwi_db db
- name: migrations rollback
run: |
pip install -r requirements/devel.txt
pip install -r requirements/postgres.txt
pushd tcms/ && ./npm-install && popd
export LANG=en-us
# Postgres b/c it has best support for schema altering operations
export DJANGO_SETTINGS_MODULE=tcms.settings.test.postgresql
./tests/migrations-rollback
6 changes: 6 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: npm audit
run: |
pushd tcms/
Expand Down
88 changes: 58 additions & 30 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,17 @@ jobs:

steps:
- uses: actions/checkout@v4

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Configure ~/.tcms.conf for ${{ matrix.kiwitcms-url }}
run: |
echo "[tcms]" > ~/.tcms.conf
Expand Down Expand Up @@ -79,36 +85,41 @@ jobs:
python-version: [3.11]

steps:
- uses: actions/checkout@v4

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

- name: Install Python dependencies
run: |
sudo apt-get update
sudo apt-get install gettext
pip install -r requirements/devel.txt
pushd tcms/ && npm install --dev && ./node_modules/.bin/webpack && popd
pushd tcms/ && ./npm-install && popd
- name: Run test
run: |
export LANG=en-us
export TEST_DASHBOARD_CHECK_UNAPPLIED_MIGRATIONS=1
coverage run --source='.' ./manage.py test -v2 --noinput --settings=tcms.settings.test tcms.core.tests.test_views.TestDashboardCheckMigrations
coverage report -m
- name: Send coverage to codecov.io
if: env.CODECOV_TOKEN
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: false
verbose: true
- uses: actions/checkout@v4

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install Python dependencies
run: |
sudo apt-get update
sudo apt-get install gettext
pip install -r requirements/devel.txt
pushd tcms/ && npm install --dev && ./node_modules/.bin/webpack && popd
pushd tcms/ && ./npm-install && popd
- name: Run test
run: |
export LANG=en-us
export TEST_DASHBOARD_CHECK_UNAPPLIED_MIGRATIONS=1
coverage run --source='.' ./manage.py test -v2 --noinput --settings=tcms.settings.test tcms.core.tests.test_views.TestDashboardCheckMigrations
coverage report -m
- name: Send coverage to codecov.io
if: env.CODECOV_TOKEN
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: false
verbose: true

without_internal_bugtracker:
name: without internal bugtracker
Expand All @@ -124,6 +135,11 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Execute tests
run: |
sudo apt-get update
Expand Down Expand Up @@ -159,11 +175,17 @@ jobs:

steps:
- uses: actions/checkout@v4

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Create database
run: |
docker compose pull db
Expand Down Expand Up @@ -207,11 +229,17 @@ jobs:

steps:
- uses: actions/checkout@v4

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Create database
run: |
docker compose -f docker-compose.postgres pull db
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.buildroot
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# checkov:skip=CKV_DOCKER_7:Ensure the base image uses a non latest version tag
FROM registry.access.redhat.com/ubi9-minimal

RUN microdnf -y --nodocs install python3.11-devel mariadb-connector-c-devel tar gzip make \
RUN microdnf -y module enable nodejs:22 && \
microdnf -y --nodocs install python3.11-devel mariadb-connector-c-devel tar gzip make \
postgresql-devel libffi-devel gcc gettext npm unzip which rust cargo findutils \
libjpeg-turbo-devel && \
microdnf -y --nodocs update && \
Expand Down

0 comments on commit 5b83c51

Please sign in to comment.