-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Configured .github/workflows for automated CI/CD testing and p…
…ublish.
- Loading branch information
1 parent
8a21f98
commit d04dbd0
Showing
3 changed files
with
103 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,5 @@ | ||
# Always validate the PR title AND all the commits | ||
titleAndCommits: true | ||
# Allows use of Merge commits (eg on github: "Merge branch 'master' into feature/ride-unicorns") | ||
# this is only relevant when using commitsOnly: true (or titleAndCommits: true) | ||
allowMergeCommits: true |
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,52 @@ | ||
name: fits/publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
ci: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [17] | ||
|
||
steps: | ||
- name: Checkout 🛎 | ||
uses: actions/checkout@master | ||
|
||
# Setup .npmrc file to publish to GitHub Packages | ||
- name: Setup node env 🏗 and .npmrc file to publish to GitHub Packages | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ matrix.node }} | ||
registry-url: 'https://npm.pkg.github.com' | ||
# Defaults to the user or organization that owns the workflow file: | ||
scope: '@observerly' | ||
|
||
- name: Cache node_modules 📦 | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Install project dependencies 👨🏻💻 | ||
run: npm ci | ||
|
||
- name: Build the package ready for publishing | ||
run: npm run build | ||
|
||
- uses: JS-DevTools/npm-publish@v1 | ||
with: | ||
registry: 'https://npm.pkg.github.com' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
check-version: true | ||
|
||
- if: steps.publish.outputs.type != 'none' | ||
run: | | ||
echo "@observerly/polaris package version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}" |
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,46 @@ | ||
name: fits/vitest | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
unit: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [16, 17] | ||
|
||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- name: Checkout 🛎 | ||
uses: actions/checkout@master | ||
|
||
# Setup .npmrc file to publish to GitHub Packages | ||
- name: Setup node env 🏗 and .npmrc file to publish to GitHub Packages | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ matrix.node }} | ||
registry-url: 'https://npm.pkg.github.com' | ||
# Defaults to the user or organization that owns the workflow file: | ||
scope: '@observerly' | ||
|
||
- name: Cache node_modules 📦 | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Install project dependencies 👨🏻💻 | ||
run: npm ci | ||
|
||
- name: Run vitest tests 🧪 | ||
run: npm run test |