-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FSMCPB-152082] Migrate to GHA (#166)
* [FSMCPB-152082] Migrate to GHA * update gha * update gha * update gha * update ts dependency version * revert ts bump * test the test step * revert test changes * include push workflow * update changes * test * test * test * test * test * test * test * test npm publish * final changes * Revert changes on ShellSdk.spec.ts
- Loading branch information
Showing
2 changed files
with
96 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: fsm-shell pull request | ||
run-name: '[ON_PR fsm-shell] ${{ github.sha }}' | ||
|
||
on: | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
- name: Install dependencies | ||
run: npm i | ||
- name: Unit tests | ||
run: npm run test:ci:headless | ||
|
||
test-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
- name: Install dependencies | ||
run: npm i | ||
- name: Run build | ||
run: npm run build |
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: fsm-shell push | ||
run-name: '[ON_PUSH fsm-shell] ${{ github.sha }}' | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
ensure-mandatory-files: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Check | ||
env: | ||
REQUIRED_FILES: CHANGELOG.md package.json package-lock.json | ||
run: | | ||
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* | ||
FILES_CHANGED=$(git diff --diff-filter='AMTCR' --name-only origin/master HEAD | tr '[:upper:]' '[:lower:]') | ||
echo $FILES_CHANGED | ||
array=( $REQUIRED_FILES ) | ||
missing_files="" | ||
for i in "${array[@]}" | ||
do | ||
[[ ${FILES_CHANGED[*]} =~ $i ]] && echo "$i file found in the changeset" || missing_files="$missing_files $i" | ||
done | ||
echo "" | ||
[ -z "$missing_files" ] && echo "All mandatory files have been modified" || echo "Following files $missing_files have not been modified" | ||
[ -z "$missing_files" ] && exit 0 || exit 1 | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
- name: Install dependencies | ||
run: npm i | ||
- name: Unit tests | ||
run: npm run test:ci:headless | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- test | ||
- ensure-mandatory-files | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
- name: Install dependencies | ||
run: npm i | ||
- name: Run build | ||
run: npm run build | ||
- name: Prepare files | ||
run: | | ||
mkdir npm_public | ||
mv release package.json package-lock.json npm_public | ||
cd npm_public | ||
echo //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} > .npmrc | ||
- name: Publish | ||
run: | | ||
cd npm_public | ||
npm publish |