-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (34 loc) · 1006 Bytes
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Test
on: [push]
jobs:
test:
env:
RAILS_ENV: "test"
TEST_DATABASE_URL: "mysql2://root:[email protected]:3306/unipept_test"
runs-on: ubuntu-latest
services:
mysql:
image: mariadb:10.9
env:
MYSQL_DATABASE: "unipept_test"
MYSQL_ROOT_PASSWORD: "unipept"
MYSQL_HOST: "localhost"
ports:
- 3306:3306
options: --health-cmd "mysqladmin ping -h localhost" --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: Run tests
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
bundle exec rails db:test:prepare
bundle exec rails test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}