Skip to content

Commit

Permalink
ci: move to Github Actions (#530)
Browse files Browse the repository at this point in the history
  • Loading branch information
naorpeled committed Nov 13, 2023
1 parent b86bce1 commit efb8e61
Show file tree
Hide file tree
Showing 6 changed files with 13,881 additions and 12,442 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/merge-to-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: 'Merge to master'

on:
push:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

steps:
- name: Get branch name (merge)
if: github.event_name != 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV

- name: Get branch name (pull request)
if: github.event_name == 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV

- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build
- run: nyc npm test && nyc report --reporter=text-lcov | ./node_modules/coveralls/bin/coveralls.js
env:
COVERALLS_SERVICE_NAME: GithubActions
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_GIT_BRANCH: ${{ env.BRANCH_NAME }}
27 changes: 0 additions & 27 deletions .github/workflows/nodejs.yml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: 'Pull Request'
on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [12, 14, 16, 18, 20]
name: Node ${{ matrix.node }}
steps:
- name: 'Checkout latest code'
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Run tests
run: npm run test

lint:
name: 'ESLint'
runs-on: ubuntu-latest
steps:
- name: Checkout latest code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: Run ESLint
run: npm run lint:check
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit efb8e61

Please sign in to comment.