Skip to content

Commit

Permalink
Merge pull request #87 from TransbankDevelopers/chore/migrate-travis-…
Browse files Browse the repository at this point in the history
…to-github

chore: migrate travis to github
  • Loading branch information
tribiec authored Jan 25, 2024
2 parents 11b3d11 + 5960017 commit cfe324c
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 43 deletions.
78 changes: 62 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,81 @@
name: Build
name: Node.js CI

on:
workflow_dispatch:
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- '**'
push:
branches:
- main
- develop
- feat/*
- bug/*
- chore/*
- master
tags:
- '*'

jobs:

SonarCloud:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [11.x, 12.x, 13.x, 14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
sonar-cloud-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install dependencies
run: npm install
- name: Test and coverage
run: npm run test:coverage
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.branch.name=${{ env.GITHUB_REF_NAME }}
build-and-publish:
if: github.ref == 'refs/heads/master' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['11.x']
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: npm publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

0 comments on commit cfe324c

Please sign in to comment.