Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor GitHub action for Bundle Test #1852

Merged
merged 2 commits into from
Sep 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 24 additions & 7 deletions .github/workflows/pull_request_review.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# This workflow will do a clean install of your theme's dependencies and attempt to bundle the theme with Stencil CLI.
# If the theme fails to bundle, you can review the error logs to find out why.
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI
name: Theme Bundling Test

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

jobs:
build:
Expand All @@ -22,6 +23,14 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Ruby Gem cache
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing hash for restore ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copied from here: https://github.com/actions/cache/blob/main/examples.md#ruby---bundler

I see cache hits in recent runs.

${{ runner.os }}-gems-

- name: Setup Ruby 2.7
uses: ruby/setup-ruby@v1.40.0
with:
Expand All @@ -33,14 +42,22 @@ jobs:
with:
node-version: ${{ matrix.node }}

- name: npm cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this missing the hash for restore ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


- name: Install Stencil CLI Dependency
run: npm install -g @bigcommerce/stencil-cli

- name: Install Dependencies
- name: Install Theme Dependencies
run: npm ci

- name: Grunt Check
run: npx grunt check

- name: Validate theme bundle
- name: Validate theme successfully bundles
run: npx stencil bundle