mirror of
https://github.com/l5yth/potato-mesh.git
synced 2026-03-28 17:42:48 +01:00
74 lines
2.0 KiB
YAML
74 lines
2.0 KiB
YAML
# Copyright © 2025-26 l5yth & contributors
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
name: Ruby
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
paths:
|
|
- '.github/**'
|
|
- 'web/**'
|
|
- 'tests/**'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
sinatra:
|
|
defaults:
|
|
run:
|
|
working-directory: ./web
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
ruby-version: ['3.4', '4.0']
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- name: Set up Ruby
|
|
uses: ruby/setup-ruby@v1
|
|
with:
|
|
ruby-version: ${{ matrix.ruby-version }}
|
|
bundler-cache: true
|
|
working-directory: ./web
|
|
- name: Set up dependencies
|
|
run: bundle install
|
|
- name: Run tests
|
|
run: |
|
|
mkdir -p tmp/test-results
|
|
bundle exec rspec \
|
|
--require rspec_junit_formatter \
|
|
--format progress \
|
|
--format RspecJunitFormatter \
|
|
--out tmp/test-results/rspec.xml
|
|
- name: Upload test results to Codecov
|
|
uses: codecov/test-results-action@v1
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
files: ./web/tmp/test-results/rspec.xml
|
|
flags: sinatra-${{ matrix.ruby-version }}
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
fail_ci_if_error: false
|
|
flags: sinatra-${{ matrix.ruby-version }}
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
- name: Run rufo
|
|
run: bundle exec rufo --check .
|