Conversation
Matrix buildsGreat work so far! By targeting specific versions of Node, we've configured a build matrix which allow us to test across multiple operating systems, platforms, and language versions. See Configuring a matrix build in GitHub Help if you'd like to learn more. I'll respond when you commit the changes in the comment below. |
Co-authored-by: github-learning-lab[bot] <37936606+github-learning-lab[bot]@users.noreply.github.com>
New JobGreat, if you look at the logs now, you'll notice that multiple builds will exist: 4 build to be exact! That's because for each of the 2 operating systems we're running tests against 2 versions so: 2 OS ✖️ 2 Node.js versions = 4 builds. Our custom workflow now accounts for:
Step 9: Use multiple jobsLet's now try to create a dedicated test job. This will allow us to separate the build and test functions of our workflow. Activity: Edit your workflow file to separate build and test jobs
If you'd like to copy and paste the full workflow file instead, click here to see it in its entirety.name: Node CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: npm install and build webpack
run: |
npm install
npm run build
test:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, windows-2016]
node-version: [8.x, 10.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, and test
run: |
npm install
npm test
env:
CI: trueWhen you commit to this branch, the workflow should run again. I'll respond when it is finished running. Actions workflow not running? Click hereWhen a GitHub Actions workflow is running, you should see some checks in progress, like the screenshot below. If the checks don't appear or if the checks are stuck in progress, there's a few things you can do to try and trigger them:
|
Waiting on testsGreat! We've now got two nicely separated
If you'd like to learn more about jobs, see:
Step 10: Run multiple jobs⌨️ Activity: Wait for the result of multiple jobs in your workflowNo action required in this step - just waiting. I'll respond when the workflow runs your jobs. Actions workflow not running? Click hereWhen a GitHub Actions workflow is running, you should see some checks in progress, like the screenshot below. If the checks don't appear or if the checks are stuck in progress, there's a few things you can do to try and trigger them:
|
Use the uploadThe workflow has finished running! You may notice So what do we do when we need the work product of one job in another? We can use the built-in artifact storage. Step 11: Upload a job's build artifactsFirst, we'll need to save the artifacts created from ⌨️ Activity: Use the upload action in your workflow file to save a job's build artifactsYou can follow the manual steps below, or accept the suggestion in the following comment.
I'll respond when you commit to this branch. |
Co-authored-by: github-learning-lab[bot] <37936606+github-learning-lab[bot]@users.noreply.github.com>
Use the downloadGreat! The build artifacts will now be uploaded to the artifact storage. If you wait for the workflow to finish, you'll notice the
Step 12: Download a job's build artifactsTo remedy this, we'll run ⌨️ Activity: Use the download action in your workflow file to access a prior job's build artifactsYou can follow the manual steps below, or accept the suggestions in the following comments.
I'll respond when you've edited your workflow file. |
.github/workflows/node.js.yml
Outdated
|
|
||
| - uses: actions/upload-artifact@master | ||
| with: | ||
| name: webpack artifacts |
There was a problem hiding this comment.
You can commit this suggestion directly.
| name: webpack artifacts | |
| needs: build |
There was a problem hiding this comment.
Merge the CI
Awesome work!
Our custom workflow now accounts for:
- ✅ test against multiple targets so that we know if our supported operating systems and Node.js versions are working
- ✅ dedicated test job so that we can separate out build from test details
- ✅ access to build artifacts so that we can deploy them to a target environment
Step 13: Share the improved CI workflow with the team
⌨️ Activity: Merge the pull request with the improved workflow
- Merge this pull request so our new CI workflow is available to the entire team
In the next few steps, we'll finish supporting our team's workflow:
- branch protections so that the
masterbranch can't be deleted or inadvertently broken - required reviews so that any pull requests are double checked by teammates
- obvious approvals so we can merge quickly and potentially automate merges and deployments
I'll respond when you merge this pull request.
Co-authored-by: github-learning-lab[bot] <37936606+github-learning-lab[bot]@users.noreply.github.com>
|
Let's go to the next step. |

No description provided.