fix: GitHub ci #142
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
lint_js: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".tool-versions" | |
cache: "yarn" | |
- name: Run ESLint | |
run: | | |
yarn install --frozen-lockfile | |
yarn lint | |
lint_ruby: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler: default | |
bundler-cache: true | |
rubygems: latest | |
- name: Run rubocop | |
run: ./bin/rubocop | |
test_system: | |
needs: | |
- lint_js | |
- lint_ruby | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ruby: ["3.1", "3.2", "3.3"] | |
gemfile: | |
- rails_6_1 | |
- rails_7 | |
- rails_7_1 | |
env: | |
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile | |
BUNDLE_PATH_RELATIVE_TO_CWD: true | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".tool-versions" | |
cache: "yarn" | |
- run: | | |
yarn install --frozen-lockfile | |
yarn build | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler: default | |
bundler-cache: true | |
rubygems: latest | |
- name: Run test | |
run: bundle exec rake test:system | |
- uses: actions/upload-artifact@v4 | |
if: ${{ failure() }} | |
with: | |
path: | | |
/home/runner/work/view_components/view_components/demo/tmp/capybara/ | |
if-no-files-found: ignore | |
retention-days: 7 | |
overwrite: true | |
test_components: | |
needs: | |
- lint_js | |
- lint_ruby | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ruby: ["3.1", "3.2", "3.3"] | |
gemfile: | |
- rails_6_1 | |
- rails_7 | |
- rails_7_1 | |
env: | |
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile | |
BUNDLE_PATH_RELATIVE_TO_CWD: true | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler: default | |
bundler-cache: true | |
rubygems: latest | |
- name: Run test | |
run: bundle exec rake test:components | |
test_js: | |
needs: | |
- lint_js | |
- lint_ruby | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".tool-versions" | |
cache: "yarn" | |
- name: Install playwright OS deps | |
run: sudo apt-get install libdbus-glib-1-2 | |
- name: Install playwright browsers | |
run: npx playwright install | |
- name: Run test | |
run: | | |
yarn install --frozen-lockfile | |
yarn build:js | |
yarn test |