Skip to content

Commit

Permalink
Merge pull request #159 from tagliala/chore/run-actions-on-prs
Browse files Browse the repository at this point in the history
Run GitHub Actions on PRs
  • Loading branch information
jamesmartin authored Sep 4, 2024
2 parents 2d5c4d1 + 55f4384 commit 275d2af
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 76 deletions.
35 changes: 26 additions & 9 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
name: Integration Tests

on: [push]
on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
test-branch: [rails5, rails6, rails7]
test-branch: [rails6, rails7, rails7-shakapacker]
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Checkout test app
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: jamesmartin/inline_svg_test_app
ref: ${{ matrix.test-branch }}
path: test_app
- name: Set up Ruby 2.7
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.7
ruby-version: 3.3.4
bundler-cache: true
- name: Build local gem
run: |
gem install bundler
bundle install --jobs 4 --retry 3
bundle exec rake build
- name: Use the local gem in the test App
id: uselocalgem
uses: jacobtomlinson/gha-find-replace@0.1.1
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "gem 'inline_svg'"
replace: "gem 'inline_svg', path: '${{github.workspace}}'"
Expand All @@ -41,6 +47,17 @@ jobs:
run: |
cd $GITHUB_WORKSPACE/test_app
bundle install --jobs 4 --retry 3
- name: Set up Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20
if: matrix.test-branch == 'rails7-shakapacker'
- name: Generate Shakapacker config
run: |
cd $GITHUB_WORKSPACE/test_app
yarn install --check-files
bundle exec rake shakapacker:compile
if: matrix.test-branch == 'rails7-shakapacker'
- name: Test
run: |
cd $GITHUB_WORKSPACE/test_app
Expand Down
62 changes: 0 additions & 62 deletions .github/workflows/rails_6_webpacker_integration_tests.yaml

This file was deleted.

16 changes: 11 additions & 5 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
name: Ruby

on: [push]
on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.7
- name: Build and test with Rake
bundler-cache: true
- name: Test with Rake
run: |
gem install bundler
bundle install --jobs 4 --retry 3
bundle exec rake

0 comments on commit 275d2af

Please sign in to comment.