Skip to content

Commit

Permalink
Cristi/unit tests (#579)
Browse files Browse the repository at this point in the history
* chore: new unit tests

* chore: try with lts-1 and lts*

* chore: delete old workflow and change references
  • Loading branch information
CristiCanizales authored Sep 27, 2023
1 parent 1d55ee4 commit 7bfa0dc
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/onPushToMain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ on:

jobs:
tests:
uses: salesforcecli/github-workflows/.github/workflows/unitTest.yml@main
uses: ./.github/workflows/unitTests.yml
with:
branch: main
release:
runs-on: ubuntu-latest
needs:
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/testCommitExceptMain.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/unitTests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Unit Tests
on:
push:
branches-ignore: [main]
workflow_dispatch:
workflow_call:
inputs:
branch:
type: string
required: false

jobs:
unit-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
nodeVersion: [lts/-1, lts/*]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
cache: yarn
- uses: google/wireit@setup-github-actions-caching/v1
- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: "**/node_modules"
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}

- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
if: ${{ steps.cache-nodemodules.outputs.cache-hit != 'true' }}
- run: yarn build
- uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd
env:
SF_DISABLE_TELEMETRY: true
name: yarn test
with:
max_attempts: 2
command: yarn test
timeout_minutes: 60

0 comments on commit 7bfa0dc

Please sign in to comment.