2022-12-02 03:00:25 -05:00
|
|
|
name: Run tests
|
|
|
|
|
2023-01-01 05:11:10 -05:00
|
|
|
on: [push, pull_request]
|
2022-12-02 03:00:25 -05:00
|
|
|
|
|
|
|
jobs:
|
2023-01-01 05:11:10 -05:00
|
|
|
test:
|
2023-03-08 08:46:17 -05:00
|
|
|
runs-on: ubuntu-latest
|
2023-03-08 08:17:06 -05:00
|
|
|
|
|
|
|
# https://docs.github.com/en/actions/using-containerized-services/creating-postgresql-service-containers
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres
|
|
|
|
env:
|
|
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
2023-03-08 09:03:37 -05:00
|
|
|
ports:
|
|
|
|
- 5432:5432
|
2022-12-02 03:00:25 -05:00
|
|
|
|
|
|
|
steps:
|
2023-03-08 08:51:26 -05:00
|
|
|
- name: Install deps
|
|
|
|
run: sudo apt-get install -y libidn11-dev
|
2022-12-02 03:00:25 -05:00
|
|
|
- uses: actions/checkout@v3
|
2023-03-08 08:46:17 -05:00
|
|
|
- uses: actions/setup-python@v4
|
2022-12-02 03:00:25 -05:00
|
|
|
with:
|
2023-03-08 08:46:17 -05:00
|
|
|
python-version: '3.10'
|
2023-03-08 08:17:06 -05:00
|
|
|
- name: Install Mastodon
|
2022-12-02 03:23:00 -05:00
|
|
|
run: |
|
2023-03-08 08:46:17 -05:00
|
|
|
wget --no-verbose https://github.com/mastodon/mastodon/archive/refs/tags/v4.1.0.zip
|
2023-03-08 08:17:06 -05:00
|
|
|
unzip v4.1.0.zip
|
2023-03-08 08:46:17 -05:00
|
|
|
- uses: ruby/setup-ruby@v1
|
|
|
|
with:
|
|
|
|
ruby-version: '3.0.3'
|
|
|
|
bundler-cache: true
|
|
|
|
working-directory: 'mastodon-4.1.0'
|
|
|
|
- name: Setup database
|
|
|
|
run: |
|
2023-03-08 09:00:00 -05:00
|
|
|
cd mastodon-4.1.0
|
|
|
|
bundle exec rails db:setup
|
|
|
|
env:
|
|
|
|
RAILS_ENV: development
|
|
|
|
# with:
|
|
|
|
# working-directory: 'mastodon-4.1.0'
|
2023-03-08 08:46:17 -05:00
|
|
|
|
2023-03-08 08:17:34 -05:00
|
|
|
# - name: Run integration tests
|
|
|
|
# env:
|
|
|
|
# TOOT_TEST_HOSTNAME: localhost:3000
|
|
|
|
# TOOT_TEST_DATABASE_DSN: dbname=mastodon_development
|
2023-03-08 08:17:06 -05:00
|
|
|
|
|
|
|
# - name: Install dependencies
|
|
|
|
# run: |
|
|
|
|
# python -m pip install --upgrade pip
|
|
|
|
# pip install -e .
|
|
|
|
# pip install -r requirements-test.txt
|
|
|
|
# - name: Run tests
|
|
|
|
# run: |
|
|
|
|
# pytest
|
|
|
|
# - name: Validate minimum required version
|
|
|
|
# run: |
|
|
|
|
# vermin --target=3.6 --no-tips .
|
|
|
|
# - name: Check style
|
|
|
|
# run: |
|
|
|
|
# flake8
|