-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move CI builds from travis-ci.org to GitHub actions (#163)
- Loading branch information
Viktor Lukashov
committed
Jul 6, 2021
1 parent
45931e4
commit dff9c3d
Showing
4 changed files
with
141 additions
and
96 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Unit Tests | ||
|
||
# all pull requests | ||
on: pull_request | ||
|
||
jobs: | ||
unit-tests-p2: | ||
name: Polymer 2 on the CI agent | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Node 12.x | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 12.x | ||
|
||
- name: Check out the source code | ||
uses: actions/checkout@v2 | ||
|
||
- 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" | ||
|
||
- name: Install project npm dependencies | ||
run: "npm install --quiet --no-progress" | ||
|
||
- name: Install project Bower dependencies | ||
run: "bower install --quiet" | ||
|
||
- name: Run automated magi-cli checks | ||
run: "npm run check" | ||
|
||
- name: Run a linter | ||
run: "npm run lint" | ||
|
||
# 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" | ||
|
||
unit-tests-p3: | ||
name: Polymer 3 on SauceLabs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Node 12.x | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 12.x | ||
|
||
- name: Check out the (Polymer 2) source code | ||
uses: actions/checkout@v2 | ||
|
||
- 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" | ||
|
||
- 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" | ||
env: | ||
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} | ||
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Visual Tests | ||
|
||
# all pull requests | ||
on: pull_request | ||
|
||
jobs: | ||
visual-tests: | ||
name: Polymer 2 on SauceLabs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Node 12.x | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 12.x | ||
|
||
- name: Check out the source code | ||
uses: actions/checkout@v2 | ||
|
||
- 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" | ||
|
||
- name: Install project Bower dependencies | ||
run: "bower install --quiet" | ||
|
||
- name: Run visual tests on SauceLabs | ||
run: "gemini test --reporter html --reporter flat test/visual" | ||
env: | ||
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} | ||
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} | ||
|
||
- name: Publish the Visual Tests failures report as an Artifact for this Workflow run | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Visual tests failures report | ||
path: gemini-report/ |
This file was deleted.
Oops, something went wrong.
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