Skip to content

Commit

Permalink
Add dev workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
rgunindi committed Dec 15, 2024
1 parent 8ec3a88 commit ff08cb8
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 11 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Development CI

on:
push:
branches: [ dev, develop, development ]
pull_request:
branches: [ main, master, dev, develop, development ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libssl1.1
- name: Install dependencies
run: npm ci

- name: Run linter
run: npm run lint

- name: Run tests
run: npm test
env:
PARSE_MASTER_KEY: 'test-master-key'
PARSE_APP_ID: 'test-app-id'

build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'

- name: Install dependencies
run: npm ci

- name: Build package
run: npm pack

- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: package
path: "*.tgz"
27 changes: 16 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,40 @@
name: Node.js Package
name: Release

on:
push:
branches: [ main ]
branches: [ main, master ]
tags:
- 'v*'
release:
types: [created]

jobs:
build-and-test:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16

# Install required system dependencies

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libssl1.1
# Install dependencies and run tests
- run: npm ci
- run: npm test
- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test
env:
PARSE_MASTER_KEY: 'test-master-key'
PARSE_APP_ID: 'test-app-id'

publish-npm:
needs: build-and-test
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'release' || startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -43,8 +47,9 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-gpr:
needs: build-and-test
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'release' || startsWith(github.ref, 'refs/tags/v')
permissions:
packages: write
contents: read
Expand Down

0 comments on commit ff08cb8

Please sign in to comment.