This repository has been archived by the owner on Aug 10, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from chromeos/degit-globs
Add CI testing with GitHub Actions
- Loading branch information
Showing
10 changed files
with
141 additions
and
171 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,85 @@ | ||
name: Node CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [12.x] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Switch Node Version | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Determine Lockfile | ||
id: lockfile | ||
run: | | ||
if [[ -f "package-lock.json" || -f "npm-shrinkwrap.json" ]]; then | ||
echo "::set-output name=exists::true" | ||
else | ||
echo "::set-output name=exists::false" | ||
fi | ||
- name: Install - Lockfile | ||
if: steps.lockfile.outputs.exists == 'true' | ||
run: | | ||
npm ci | ||
- name: Install - No Lockfile | ||
if: steps.lockfile.outputs.exists == 'false' | ||
run: | | ||
npm install | ||
- name: Build and Test | ||
run: | | ||
npm run build --if-present | ||
npm test | ||
env: | ||
CI: true | ||
- name: Upload built state | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: site | ||
path: public | ||
|
||
lighthouse: | ||
needs: build-test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Download compiled site | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: site | ||
path: public | ||
- name: Lighthouse Audit | ||
uses: treosh/lighthouse-ci-action@v2 | ||
with: | ||
configPath: lighthouse.config.json | ||
# Uncomment to deploy to GitHub Pages after including a GitHub token in project's secrets | ||
# deploy: | ||
# needs: build-test | ||
# runs-on: ubuntu-latest | ||
# if: success() && github.ref == 'refs/heads/master' | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v1 | ||
# - name: Switch Node Version | ||
# uses: actions/setup-node@v1 | ||
# with: | ||
# node-version: ${{ matrix.node-version }} | ||
# - name: Install | ||
# run: | | ||
# npm ci | ||
# - name: Download compiled site | ||
# uses: actions/download-artifact@v1 | ||
# with: | ||
# name: site | ||
# path: public | ||
# - run: touch public/.nojekyll | ||
# - name: Deploy to GitHub Pages | ||
# run: npm run deploy | ||
# env: | ||
# GH_TOKEN: ${{ secrets.GH_TOKEN }} |
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 @@ | ||
v12 |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[ | ||
{ | ||
"action": "remove", | ||
"files": [".github", "CODE_OF_CONDUCT.md", ".npmrc"] | ||
"files": [".github/ISSUE_TEMPLATE", ".github/CONTRIBUTING.md", ".github/pull_request_template.md", "CODE_OF_CONDUCT.md", ".npmrc"] | ||
} | ||
] |
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,43 @@ | ||
{ | ||
"ci": { | ||
"collect": { | ||
"numberOfRuns": 3, | ||
"url": ["/en", "/fr"], | ||
"staticDistDir": "./public" | ||
}, | ||
"assert": { | ||
"assertions": { | ||
"categories:performance": [ | ||
"error", | ||
{ | ||
"minScore": 0.9 | ||
} | ||
], | ||
"categories:accessibility": [ | ||
"error", | ||
{ | ||
"minScore": 0.9 | ||
} | ||
], | ||
"categories:best-practices": [ | ||
"error", | ||
{ | ||
"minScore": 0.9 | ||
} | ||
], | ||
"categories:seo": [ | ||
"error", | ||
{ | ||
"minScore": 0.85 | ||
} | ||
], | ||
"categories:pwa": [ | ||
"error", | ||
{ | ||
"minScore": 0.9 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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