mirror of
https://github.com/david942j/one_gadget.git
synced 2026-10-12 02:12:49 +00:00
48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
permissions:
|
|
actions: write
|
|
contents: read
|
|
id-token: write
|
|
|
|
jobs:
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
continue-on-error: ${{ matrix.ruby-version == 'head' }}
|
|
strategy:
|
|
matrix:
|
|
ruby-version: ['3.3', '3.4', '4.0', 'head']
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Strip lockfile on Ruby Head to bypass mismatch bundler version
|
|
if: matrix.ruby-version == 'head'
|
|
run: |
|
|
echo "Removing Gemfile.lock"
|
|
rm -f Gemfile.lock
|
|
- name: Set up Ruby
|
|
uses: ruby/setup-ruby@v1
|
|
with:
|
|
ruby-version: ${{ matrix.ruby-version }}
|
|
bundler-cache: ${{ matrix.ruby-version != 'head' }} # runs 'bundle install' and caches installed gems automatically
|
|
- name: Install dependencies for Ruby head
|
|
if: matrix.ruby-version == 'head'
|
|
run: bundle install
|
|
- name: Install apt packages
|
|
run: sudo apt update && sudo apt install -yy grep binutils-multiarch
|
|
- name: Run tests
|
|
run: bundle exec rake
|
|
- name: Publish code coverage
|
|
if: ${{ success() && github.event.pull_request.head.repo.fork == false }}
|
|
uses: qltysh/qlty-action/coverage@v1
|
|
with:
|
|
oidc: true
|
|
files: coverage/coverage.json
|