-
Notifications
You must be signed in to change notification settings - Fork 6
perf(workflow): parallelise jobs #1429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
a4c383f
cce2319
eef34da
1409739
471eabc
2da697a
e98e7a6
0196215
e13ceab
499f53c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,97 +1,146 @@ | ||
| # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | ||
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
|
|
||
| name: Node.js CI | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| test: | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [22] | ||
| node-version: [22, 24] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v3 | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: npm | ||
| - run: npm ci | ||
| - name: Check code style | ||
| run: npm run lint | ||
|
|
||
| audit: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| node-version: [22, 24] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: npm | ||
| - name: Install production dependencies | ||
| run: npm ci --omit=dev --ignore-scripts | ||
| - name: Check npm audit | ||
| run: npm audit --omit=dev --audit-level=low | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Behaviour change: |
||
|
|
||
| - name: Install production dependencies (fail if any warning) | ||
| run: | | ||
| npm ci --omit=dev --ignore-scripts | ||
| # sh ./npm-production-install.sh | ||
| - name: Install dependencies | ||
| run: | | ||
| npm config set registry http://registry.npmjs.org | ||
| npm ci | ||
|
|
||
| docs: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| node-version: [22, 24] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: npm | ||
| - run: npm ci | ||
| - name: Install Compodoc | ||
| run: npm i -g @compodoc/compodoc | ||
|
|
||
| - name: Generate development documentation and test level of documentation coverage | ||
| - name: Generate docs and check coverage | ||
| run: npm run doc | ||
|
|
||
| - name: Check code style | ||
| run: npm run lint | ||
|
|
||
| build-and-smoke: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| node-version: [22, 24] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: npm | ||
| - run: npm ci | ||
| - name: Build Project | ||
| run: npm run build | ||
|
|
||
| - name: Test Package Install | ||
| run: | | ||
| npm version "5.0.0" --no-git-tag-version | ||
| npm pack | ||
| npm install -g ./sasjs-cli-5.0.0.tgz | ||
| sasjs v | ||
|
|
||
| - name: Run smoke tests | ||
| run: sh ./test.sh | ||
|
|
||
| unit-tests: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| node-version: [22, 24] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: npm | ||
| - run: npm ci | ||
| - name: Install Doxygen | ||
| run: sudo apt-get install -y doxygen | ||
|
|
||
| # Mocked (*.spec.ts) tests will be conducted during this step | ||
| - name: Build Project | ||
| run: npm run build | ||
| - name: Install sasjs CLI globally | ||
| run: | | ||
| npm version "5.0.0" --no-git-tag-version | ||
| npm pack | ||
| npm install -g ./sasjs-cli-5.0.0.tgz | ||
| - name: Generate coverage report | ||
| uses: artiomtr/jest-coverage-report-action@v2.0-rc.2 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| test-script: npx jest --config=jest.config.js --silent --runInBand --ci --coverage --testLocationInResults --json --outputFile="report.json" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
|
||
| - name: Install PM2 | ||
| run: npm i -g pm2 | ||
|
|
||
| server-tests: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| node-version: [22, 24] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: npm | ||
| - run: npm ci | ||
| - name: Install Doxygen | ||
| run: sudo apt-get install -y doxygen | ||
| - name: Build Project | ||
| run: npm run build | ||
| - name: Create .env file for sasjs/server | ||
| run: | | ||
| echo "RUN_TIMES=js" >> .env | ||
| echo "NODE_PATH=node" >> .env | ||
| echo "MOCK_SERVERTYPE=sas9" >> .env | ||
|
|
||
| - name: Download sasjs/server package | ||
| run: curl -L https://github.com/sasjs/server/releases/latest/download/linux.zip -o linux.zip | ||
|
|
||
| - name: Unzip downloaded package | ||
| run: unzip linux.zip | ||
|
|
||
| - name: Run sasjs server | ||
| run: pm2 start api-linux | ||
|
|
||
| - name: Unzip and start server | ||
| run: | | ||
| unzip linux.zip | ||
| npx pm2 start api-linux | ||
| - name: Install sasjs CLI globally | ||
| run: | | ||
| npm version "5.0.0" --no-git-tag-version | ||
| npm pack | ||
| npm install -g ./sasjs-cli-5.0.0.tgz | ||
| - name: Deploy SAS9 tests | ||
| run: | | ||
| cd mocks | ||
| sasjs cbd | ||
| cd .. | ||
| ls sasjs_root -R | ||
|
|
||
| - name: Run server tests | ||
| run: npm run test:server | ||
| env: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,7 +152,7 @@ module.exports = { | |
| testMatch: ['**/*spec.[j|t]s?(x)'], | ||
|
|
||
| // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped | ||
| testPathIgnorePatterns: ['/node_modules/', '<rootDir>/build/'], | ||
| testPathIgnorePatterns: ['/node_modules/', '<rootDir>/build/', 'test-app-create-', 'test-app-init-'], | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good fix to prevent Jest from picking up spec files inside generated |
||
|
|
||
| // The regexp pattern or array of patterns that Jest uses to detect test files | ||
| // testRegex: [], | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node versions hardcoded as
[22, 24]here, whilerun-tests-windows.ymlandnpmpublish.ymluselts/jod. If the intent is to test across two major versions, a brief comment would help future maintainers understand why this matrix differs from the alias-based approach elsewhere.