Skip to content
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

ci: Added .github/workflows to workspace for CI/CD tooling. #1

Merged
merged 1 commit into from
Aug 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/semantic.yml
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
49 changes: 49 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: astrometry/lint

on:
pull_request:
branches:
- main

jobs:
unit:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [18]

env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_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/setup-node@v3
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 pnpm globally
run: npm install -g pnpm@8.6.12

- name: Install project dependencies 👨🏻‍💻
run: pnpm install

- name: Run formatting checks 🧹
run: pnpm run format
49 changes: 49 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: astrometry/lint

on:
pull_request:
branches:
- main

jobs:
unit:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [18]

env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_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/setup-node@v3
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 pnpm globally
run: npm install -g pnpm@8.6.12

- name: Install project dependencies 👨🏻‍💻
run: pnpm install

- name: Run linting 🧹
run: pnpm run lint
61 changes: 61 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: astrometry/publish

on:
release:
types: [published]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
ci:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [18]

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/setup-node@v2.1.2
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 pnpm globally
run: npm install -g pnpm@8.6.12

- name: Install project dependencies 👨🏻‍💻
run: pnpm install

- name: Build the package ready for publishing
run: pnpm 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/astrometry package version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}"
57 changes: 57 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: astrometry/vitest

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
unit:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [18, 19]

env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Vite App Specific Environment Variables
VITE_FIBER_API_BASE_URL: ${{ secrets.FIBER_API_BASE_URL }}

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/setup-node@v2.1.2
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 pnpm globally
run: npm install -g pnpm@8.6.1

- name: Install project dependencies 👨🏻‍💻
run: pnpm install

- name: Build the package ready for publishing
run: pnpm run build

- name: Run vitest tests 🧪
run: pnpm run test
Loading