Skip to content

Commit

Permalink
Optimize OS version matrix strategy for CI workflow (#47)
Browse files Browse the repository at this point in the history
Before the CI workflow used a matrix strategy to run the `lint-node`
job, but this was not necessary for this repository. It has been
improved to make the workflow run faster by avoiding unnecessary steps:

- The `lint-node` job has been changed to only run on the currently
  latest stable Node version `14.x` [1] only on Linux because this
  repository is not focused on JavaScript but only runs Node based tools
  to lint other files within this repository.

These changes also help to keep the required GitHub Action run minutes
for the account of this repository as small as possible without wasting
resources for unnecessary tasks.

[1]: https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V14.md#14.12.0

Resolves GH-46
  • Loading branch information
svengreb authored Sep 25, 2020
1 parent 43d41df commit cb77258
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,19 @@ on:
jobs:
lint-node:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x]
steps:
- name: Print metadata and context information
env:
TMPL_GITHUB_ACTION_CONTEXT_RUNNER: ${{ toJson(runner) }}
run: |
echo "Git SHA: $GITHUB_SHA"
echo "Git Ref: $GITHUB_REF"
echo "Workflow Actor: $GITHUB_ACTOR"
echo "GitHub Action Runner: $TMPL_GITHUB_ACTION_CONTEXT_RUNNER"
- name: Checkout repository
uses: actions/checkout@v2
- name: "Setup Node.js version ${{ matrix.node-version }}"
- name: "Setup Node.js version 14.x"
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
node-version: "14.x"
- name: Install Node modules
run: yarn --frozen-lockfile
- name: Run linter
- name: Run linters
run: yarn lint

0 comments on commit cb77258

Please # to comment.