Skip to content

Commit

Permalink
chore: add lockfiles to ensure consistent builds in CI (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan authored Jan 17, 2022
1 parent b55ee37 commit 8792b58
Show file tree
Hide file tree
Showing 7 changed files with 55,236 additions and 18 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ jobs:
- name: Check out the source code
uses: actions/checkout@v2

- name: Install latest npm
# magi-cli 1.0 requires npm 7 or higher
run: "npm install -g npm@8"

- name: Install global npm dependencies
# bower is needed to run 'bower install'
# polymer-cli is needed to run the lint step
# web-component-tester is needed to run the test step
run: "npm install --quiet --no-progress --global bower polymer-cli web-component-tester"
run: "npm install --quiet --no-progress --global bower polymer-cli"

- name: Install project npm dependencies
run: "npm install --quiet --no-progress"
run: "npm ci"

- name: Install project Bower dependencies
run: "bower install --quiet"
Expand All @@ -36,7 +39,7 @@ jobs:

# the full set of environments is tested with Polymer 3 below
- name: Run unit tests locally (in the VM instance running this job)
run: "xvfb-run -s '-screen 0 1024x768x24' wct"
run: "xvfb-run -s '-screen 0 1024x768x24' npm test"

unit-tests-p3:
name: Polymer 3 on SauceLabs
Expand All @@ -50,29 +53,26 @@ jobs:
- name: Check out the (Polymer 2) source code
uses: actions/checkout@v2

- name: Install latest npm
# magi-cli 1.0 requires npm 7 or higher
run: "npm install -g npm@8"

- name: Install global npm dependencies
# magi-cli, bower and polymer-modulizer are needed to run the Polymer 3 conversion step
# web-component-tester is needed to run the test step
run: "npm install --quiet --no-progress --global bower magi-cli web-component-tester polymer-modulizer"
# bower and polymer-modulizer are needed to run the Polymer 3 conversion step
run: "npm install --quiet --no-progress --global bower magi-cli@next polymer-modulizer"

- name: Convert the source code to Polymer 3
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
magi p3-convert --out . --import-style=name
# Using yarn instead of npm here to check that the dependency tree does not have two
# versions of the same component. With P2 / Bower that is checked automatically, but
# with P3 / npm it is not.
- name: Install project npm dependencies
run: "yarn install --flat"

# workaround for running tests on Android on SauceLabs (see wct.conf.js)
- name: Add 'localhost-for-saucelabs' to /etc/hosts
run: echo "127.0.0.1 localhost-for-saucelabs" | sudo tee -a /etc/hosts

- name: Run unit tests on SauceLabs
run: "wct --npm --env saucelabs"
run: "npm test -- --env saucelabs"
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
6 changes: 5 additions & 1 deletion .github/workflows/visual-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ jobs:
- name: Check out the source code
uses: actions/checkout@v2

- name: Install latest npm
# magi-cli 1.0 requires npm 7 or higher
run: "npm install -g npm@8"

- name: Install global npm dependencies
# bower is needed to run 'bower install'
# gemini is needed to run the visual tests step
run: "npm install --quiet --no-progress --global bower gemini@^4.0.0 gemini-sauce gemini-polyserve"

- name: Install project npm dependencies
run: "npm install --quiet --no-progress"
run: "npm ci"

- name: Install project Bower dependencies
run: "bower install --quiet"
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
bower_components
node_modules
package-lock.json
yarn.lock
coverage
analysis.json
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

Loading

0 comments on commit 8792b58

Please sign in to comment.