Skip to content

Merge pull request #5769 from dodona-edu/dependabot/npm_and_yarn/type… #9898

Merge pull request #5769 from dodona-edu/dependabot/npm_and_yarn/type…

Merge pull request #5769 from dodona-edu/dependabot/npm_and_yarn/type… #9898

Workflow file for this run

name: Test
on:
push:
branches:
- main
tags:
- '*'
pull_request:
workflow_call:
jobs:
ruby:
name: Test Ruby
env:
RAILS_ENV: "test"
TEST_DATABASE_URL: "mysql2://root:[email protected]:3306/dodona_test"
runs-on: ubuntu-latest
services:
mysql:
image: mariadb
env:
MYSQL_DATABASE: "dodona_test"
MYSQL_ROOT_PASSWORD: "dodona"
MARIADB_MYSQL_LOCALHOST_USER: 1
MARIADB_MYSQL_LOCALHOST_GRANTS: USAGE
MYSQL_HOST: "localhost"
ports:
- 3306:3306
options: --health-cmd="healthcheck.sh --su-mysql --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=5
steps:
- uses: actions/checkout@v4
- name: Use ruby from .ruby-version
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Use node 22
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: yarn
- name: Run tests
env:
CI: true
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "Dodona"
sudo sysctl fs.inotify.max_user_watches=524288
sudo sysctl -p
bundle exec rails test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: rails
javascript:
name: Test JavaScript
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: yarn
- name: Install dependencies
run: |
yarn install
- name: Test
run: |
yarn test --ci --runInBand --coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: javascript
system:
name: Test System
env:
DISABLE_SPRING: "true"
RAILS_ENV: "test"
TEST_DATABASE_URL: "mysql2://root:[email protected]:3306/dodona_test"
runs-on: ubuntu-latest
services:
mysql:
image: mariadb
env:
MYSQL_DATABASE: "dodona_test"
MYSQL_ROOT_PASSWORD: "dodona"
MARIADB_MYSQL_LOCALHOST_USER: 1
MARIADB_MYSQL_LOCALHOST_GRANTS: USAGE
MYSQL_HOST: "localhost"
ports:
- 3306:3306
options: --health-cmd="healthcheck.sh --su-mysql --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=5
steps:
- uses: actions/checkout@v4
- name: Use ruby from .ruby-version
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Use node 22
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: yarn
- name: Setup chromium-chromedriver
uses: nanasess/setup-chromedriver@master
- name: Show installed chrome version
run: |
google-chrome --version
- name: Run tests
env:
CI: true
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
PARALLEL_WORKERS: 1
run: |
git config --global user.email "[email protected]"
git config --global user.name "Dodona"
bundle exec rails test:system
- name: Upload screenshot artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: screenshots-failure
path: tmp/capybara
- name: merge system js coverage
run: |
yarn test:system:coverage:merge
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: system