forked from shardus/lib-net
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d05de5b
commit a2a47df
Showing
1 changed file
with
5 additions
and
72 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 |
---|---|---|
@@ -1,80 +1,13 @@ | ||
name: Typescript CI Workflow | ||
name: Node CI Workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
- main | ||
pull_request: | ||
branches: | ||
- dev | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
|
||
- name: Set up Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: '${{ vars.NODE_VERSION }}' | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: | | ||
echo "Installing dependencies..." | ||
npm ci --ignore-scripts | ||
echo "Dependency installation complete." | ||
- name: Lint | ||
id: lint | ||
run: | | ||
echo "Running Linter..." | ||
npm run lint | ||
echo "Running Linter complete." | ||
continue-on-error: true | ||
|
||
- name: Format check | ||
id: format_check | ||
run: | | ||
echo "Running format check..." | ||
npm run format-check | ||
echo "Format check complete." | ||
continue-on-error: true | ||
|
||
- name: Test apply patches | ||
id: test_apply_patches | ||
run: | | ||
set -e | ||
shopt -s nullglob | ||
patches=(*.patch) | ||
if [ ${#patches[@]} -eq 0 ]; then | ||
echo "No patches to test." | ||
else | ||
for patch in "${patches[@]}"; do | ||
echo "Testing $patch" | ||
git apply --check -v "$patch" || (echo "Failed to apply patch: $patch" && exit 1) | ||
done | ||
echo "All patches applied successfully." | ||
fi | ||
continue-on-error: true | ||
|
||
- name: Build | ||
id: build | ||
run: | | ||
echo "Building the code..." | ||
npm run build | ||
echo "Build complete." | ||
- name: Unit Tests | ||
id: unit_tests | ||
run: | | ||
echo "Running Unit Tests..." | ||
npm test | ||
echo "Unit Tests complete." | ||
- name: Check if any step failed | ||
if: ${{ steps.lint.outcome == 'failure' || steps.format_check.outcome == 'failure' || steps.test_apply_patches.outcome == 'failure' }} | ||
run: exit 1 | ||
ci: | ||
uses: shardeum/github-automation/.github/workflows/node-ci-shared.yml@dev |