Skip to content

Commit

Permalink
New CI with updated action versions, cache and linters
Browse files Browse the repository at this point in the history
  • Loading branch information
matux committed Feb 24, 2024
1 parent e7381a3 commit 6a6b41b
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 26 deletions.
61 changes: 48 additions & 13 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,62 @@
name: rollbar-react CI
name: ci

on:
push:
branches: [ '**' ]
branches:
- main
pull_request:
branches: [ main ]
branches:
- main

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [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 }}
- run: npm install
- run: npm run lint
- run: npm run test
- name: Checkout
uses: actions/checkout@v4

- name: Set up node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Cache library
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-
${{ runner.os }}-node-
${{ runner.os }}-
- name: Install dependencies
run: npm ci

- name: Install examples/create-react-app dependencies
run: npm ci
working-directory: ./examples/create-react-app

- name: Install examples/nextjs dependencies
run: npm ci
working-directory: ./examples/nextjs

- name: Install examples/typescript dependencies
run: npm ci
working-directory: ./examples/typescript

- name: Lint
uses: wearerequired/lint-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
prettier: true
eslint: true
eslint_args: '--max-warnings 0'

- name: Test
run: npm run test
26 changes: 13 additions & 13 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v2
with:
node-version: '12.x'
registry-url: 'https://registry.npmjs.org'
# Defaults to the user or organization that owns the workflow file
# scope: '@rollbar'
- run: npm install
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/checkout@v2
# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v2
with:
node-version: "12.x"
registry-url: "https://registry.npmjs.org"
# Defaults to the user or organization that owns the workflow file
# scope: '@rollbar'
- run: npm install
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 6a6b41b

Please sign in to comment.