Skip to content

Commit

Permalink
Merge pull request #7 from reportportal/feature/EPMRPP-85309-setup-ci-cd
Browse files Browse the repository at this point in the history
EPMRPP-85309 || Add CI/CD pipelines for develop branch
  • Loading branch information
AmsterGet authored Oct 3, 2023
2 parents 53efa99 + bd73783 commit 6d3f87e
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @AmsterGet @Bam6ycha @Vadim73i
* @AmsterGet @Bam6ycha @Vadim73i @dmitrysurdin
36 changes: 36 additions & 0 deletions .github/workflows/CI-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI-pipeline

on:
push:
branches:
- develop
- '!main'
paths-ignore:
- README.md
- CHANGELOG.md
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Run lint
run: npm run lint

- name: Run tests and check coverage
run: npm run test:coverage
49 changes: 49 additions & 0 deletions .github/workflows/publish-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish dev package version

on:
# TODO: enable auto-publishing once all quality gates are set
# push:
# branches:
# - develop
workflow_dispatch:

jobs:
publish_dev:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Setup git credentials
run: |
git config --global user.email "support@reportportal.io"
git config --global user.name "reportportal.io"
git remote set-url origin https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
- name: Bump version - prerelease
run: npm version prerelease --preid=alpha

- name: Publish to NPM
run: |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm config list
npm publish --access public --tag alpha
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}

- name: Push version update back to repository
run: |
git push origin HEAD:${{ github.ref }} --tags
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"build:storybook": "storybook build",
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
"format": "npm run lint -- --fix",
"test": "exit 0",
"test:coverage": "exit 0",
"prepare": "husky install"
},
"files": [
Expand Down

0 comments on commit 6d3f87e

Please sign in to comment.