forked from LYITComputing/DevOps-P9
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI workflow with build and test jobs. This workflow is from DevOp…
…s-P8.
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 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,42 @@ | ||
name: Node CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: npm install and build webpack | ||
run: | | ||
npm install | ||
npm run build | ||
- uses: actions/upload-artifact@master | ||
with: | ||
name: webpack artifacts | ||
path: public/ | ||
test: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
strategy: | ||
matrix: | ||
os: [ubuntu-lastest, windows-2016] | ||
node-version: [12.x, 14.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- uses: actions/download-artifact@master | ||
with: | ||
name: webpack artifacts | ||
path: public | ||
- name: npm install, and test | ||
run: | | ||
npm install | ||
npm test | ||
env: | ||
CI: true |