mirror of
https://github.com/mastodon/mastodon.git
synced 2025-10-06 09:02:43 +00:00
Only run E2E tests
This commit is contained in:
parent
caea5dcc29
commit
41eaf43aab
306
.github/workflows/test-ruby.yml
vendored
306
.github/workflows/test-ruby.yml
vendored
|
@ -73,193 +73,6 @@ jobs:
|
||||||
name: ${{ github.sha }}
|
name: ${{ github.sha }}
|
||||||
retention-days: 0
|
retention-days: 0
|
||||||
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
needs:
|
|
||||||
- build
|
|
||||||
|
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgres:14-alpine
|
|
||||||
env:
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
options: >-
|
|
||||||
--health-cmd pg_isready
|
|
||||||
--health-interval 10ms
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
|
|
||||||
redis:
|
|
||||||
image: redis:7-alpine
|
|
||||||
options: >-
|
|
||||||
--health-cmd "redis-cli ping"
|
|
||||||
--health-interval 10ms
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 6379:6379
|
|
||||||
|
|
||||||
env:
|
|
||||||
DB_HOST: localhost
|
|
||||||
DB_USER: postgres
|
|
||||||
DB_PASS: postgres
|
|
||||||
COVERAGE: ${{ matrix.ruby-version == '.ruby-version' }}
|
|
||||||
RAILS_ENV: test
|
|
||||||
ALLOW_NOPAM: true
|
|
||||||
PAM_ENABLED: true
|
|
||||||
PAM_DEFAULT_SERVICE: pam_test
|
|
||||||
PAM_CONTROLLED_SERVICE: pam_test_controlled
|
|
||||||
OIDC_ENABLED: true
|
|
||||||
OIDC_SCOPE: read
|
|
||||||
SAML_ENABLED: true
|
|
||||||
CAS_ENABLED: true
|
|
||||||
BUNDLE_WITH: 'pam_authentication test'
|
|
||||||
GITHUB_RSPEC: ${{ matrix.ruby-version == '.ruby-version' && github.event.pull_request && 'true' }}
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
ruby-version:
|
|
||||||
- '3.2'
|
|
||||||
- '3.3'
|
|
||||||
- '.ruby-version'
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: './'
|
|
||||||
name: ${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Expand archived asset artifacts
|
|
||||||
run: |
|
|
||||||
tar xvzf artifacts.tar.gz
|
|
||||||
|
|
||||||
- name: Set up Ruby environment
|
|
||||||
uses: ./.github/actions/setup-ruby
|
|
||||||
with:
|
|
||||||
ruby-version: ${{ matrix.ruby-version}}
|
|
||||||
additional-system-dependencies: ffmpeg libpam-dev
|
|
||||||
|
|
||||||
- name: Load database schema
|
|
||||||
run: |
|
|
||||||
bin/rails db:setup
|
|
||||||
bin/flatware fan bin/rails db:test:prepare
|
|
||||||
|
|
||||||
- name: Cache RSpec persistence file
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
tmp/rspec/examples.txt
|
|
||||||
key: rspec-persistence-${{ github.head_ref || github.ref_name }}-${{ github.sha }}
|
|
||||||
restore-keys: |
|
|
||||||
rspec-persistence-${{ github.head_ref || github.ref_name }}-${{ github.sha }}-${{ matrix.ruby-version }}
|
|
||||||
rspec-persistence-${{ github.head_ref || github.ref_name }}-${{ github.sha }}
|
|
||||||
rspec-persistence-${{ github.head_ref || github.ref_name }}
|
|
||||||
rspec-persistence-main
|
|
||||||
rspec-persistence
|
|
||||||
|
|
||||||
- run: bin/flatware rspec -r ./spec/flatware_helper.rb
|
|
||||||
|
|
||||||
- name: Upload coverage reports to Codecov
|
|
||||||
if: matrix.ruby-version == '.ruby-version'
|
|
||||||
uses: codecov/codecov-action@v5
|
|
||||||
with:
|
|
||||||
files: coverage/lcov/*.lcov
|
|
||||||
env:
|
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
|
|
||||||
test-imagemagick:
|
|
||||||
name: ImageMagick tests
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
needs:
|
|
||||||
- build
|
|
||||||
|
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgres:14-alpine
|
|
||||||
env:
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
options: >-
|
|
||||||
--health-cmd pg_isready
|
|
||||||
--health-interval 10ms
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
|
|
||||||
redis:
|
|
||||||
image: redis:7-alpine
|
|
||||||
options: >-
|
|
||||||
--health-cmd "redis-cli ping"
|
|
||||||
--health-interval 10ms
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 6379:6379
|
|
||||||
|
|
||||||
env:
|
|
||||||
DB_HOST: localhost
|
|
||||||
DB_USER: postgres
|
|
||||||
DB_PASS: postgres
|
|
||||||
COVERAGE: ${{ matrix.ruby-version == '.ruby-version' }}
|
|
||||||
RAILS_ENV: test
|
|
||||||
ALLOW_NOPAM: true
|
|
||||||
PAM_ENABLED: true
|
|
||||||
PAM_DEFAULT_SERVICE: pam_test
|
|
||||||
PAM_CONTROLLED_SERVICE: pam_test_controlled
|
|
||||||
OIDC_ENABLED: true
|
|
||||||
OIDC_SCOPE: read
|
|
||||||
SAML_ENABLED: true
|
|
||||||
CAS_ENABLED: true
|
|
||||||
BUNDLE_WITH: 'pam_authentication test'
|
|
||||||
GITHUB_RSPEC: ${{ matrix.ruby-version == '.ruby-version' && github.event.pull_request && 'true' }}
|
|
||||||
MASTODON_USE_LIBVIPS: false
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
ruby-version:
|
|
||||||
- '3.2'
|
|
||||||
- '3.3'
|
|
||||||
- '.ruby-version'
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: './'
|
|
||||||
name: ${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Expand archived asset artifacts
|
|
||||||
run: |
|
|
||||||
tar xvzf artifacts.tar.gz
|
|
||||||
|
|
||||||
- name: Set up Ruby environment
|
|
||||||
uses: ./.github/actions/setup-ruby
|
|
||||||
with:
|
|
||||||
ruby-version: ${{ matrix.ruby-version}}
|
|
||||||
additional-system-dependencies: ffmpeg imagemagick libpam-dev
|
|
||||||
|
|
||||||
- name: Load database schema
|
|
||||||
run: './bin/rails db:create db:schema:load db:seed'
|
|
||||||
|
|
||||||
- run: bin/rspec --tag attachment_processing
|
|
||||||
|
|
||||||
- name: Upload coverage reports to Codecov
|
|
||||||
if: matrix.ruby-version == '.ruby-version'
|
|
||||||
uses: codecov/codecov-action@v5
|
|
||||||
with:
|
|
||||||
files: coverage/lcov/mastodon.lcov
|
|
||||||
env:
|
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
|
|
||||||
test-e2e:
|
test-e2e:
|
||||||
name: End to End testing
|
name: End to End testing
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -347,122 +160,3 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: e2e-screenshots
|
name: e2e-screenshots
|
||||||
path: tmp/capybara/
|
path: tmp/capybara/
|
||||||
|
|
||||||
test-search:
|
|
||||||
name: Elastic Search integration testing
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
needs:
|
|
||||||
- build
|
|
||||||
|
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgres:14-alpine
|
|
||||||
env:
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
options: >-
|
|
||||||
--health-cmd pg_isready
|
|
||||||
--health-interval 10ms
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
|
|
||||||
redis:
|
|
||||||
image: redis:7-alpine
|
|
||||||
options: >-
|
|
||||||
--health-cmd "redis-cli ping"
|
|
||||||
--health-interval 10ms
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 6379:6379
|
|
||||||
|
|
||||||
elasticsearch:
|
|
||||||
image: ${{ contains(matrix.search-image, 'elasticsearch') && matrix.search-image || '' }}
|
|
||||||
env:
|
|
||||||
discovery.type: single-node
|
|
||||||
xpack.security.enabled: false
|
|
||||||
options: >-
|
|
||||||
--health-cmd "curl http://localhost:9200/_cluster/health"
|
|
||||||
--health-interval 2s
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 9200:9200
|
|
||||||
|
|
||||||
opensearch:
|
|
||||||
image: ${{ contains(matrix.search-image, 'opensearch') && matrix.search-image || '' }}
|
|
||||||
env:
|
|
||||||
discovery.type: single-node
|
|
||||||
DISABLE_INSTALL_DEMO_CONFIG: true
|
|
||||||
DISABLE_SECURITY_PLUGIN: true
|
|
||||||
options: >-
|
|
||||||
--health-cmd "curl http://localhost:9200/_cluster/health"
|
|
||||||
--health-interval 2s
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 9200:9200
|
|
||||||
|
|
||||||
env:
|
|
||||||
DB_HOST: localhost
|
|
||||||
DB_USER: postgres
|
|
||||||
DB_PASS: postgres
|
|
||||||
RAILS_ENV: test
|
|
||||||
BUNDLE_WITH: test
|
|
||||||
ES_ENABLED: true
|
|
||||||
ES_HOST: localhost
|
|
||||||
ES_PORT: 9200
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
ruby-version:
|
|
||||||
- '3.2'
|
|
||||||
- '3.3'
|
|
||||||
- '.ruby-version'
|
|
||||||
search-image:
|
|
||||||
- docker.elastic.co/elasticsearch/elasticsearch:7.17.13
|
|
||||||
include:
|
|
||||||
- ruby-version: '.ruby-version'
|
|
||||||
search-image: docker.elastic.co/elasticsearch/elasticsearch:8.10.2
|
|
||||||
- ruby-version: '.ruby-version'
|
|
||||||
search-image: opensearchproject/opensearch:2
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: './'
|
|
||||||
name: ${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Set up Ruby environment
|
|
||||||
uses: ./.github/actions/setup-ruby
|
|
||||||
with:
|
|
||||||
ruby-version: ${{ matrix.ruby-version}}
|
|
||||||
additional-system-dependencies: ffmpeg
|
|
||||||
|
|
||||||
- name: Set up Javascript environment
|
|
||||||
uses: ./.github/actions/setup-javascript
|
|
||||||
|
|
||||||
- name: Load database schema
|
|
||||||
run: './bin/rails db:create db:schema:load db:seed'
|
|
||||||
|
|
||||||
- run: bin/rspec --tag search
|
|
||||||
|
|
||||||
- name: Archive logs
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
if: failure()
|
|
||||||
with:
|
|
||||||
name: test-search-logs-${{ matrix.ruby-version }}
|
|
||||||
path: log/
|
|
||||||
|
|
||||||
- name: Archive test screenshots
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
if: failure()
|
|
||||||
with:
|
|
||||||
name: test-search-screenshots
|
|
||||||
path: tmp/capybara/
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user