move to github actions (#192)

This commit is contained in:
Paul Irish 2022-07-18 14:19:56 -07:00 committed by GitHub
parent 1a93477f70
commit 0b626514bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 23 deletions

33
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,33 @@
name: CI
on:
push:
branches: [master]
pull_request: # run on all PRs, not just PRs to a particular branch
jobs:
basics:
runs-on: ubuntu-latest
steps:
- name: git clone
uses: actions/checkout@v3
with:
fetch-depth: 100
- uses: actions/setup-node@v3
with:
node-version: latest
- run: npm ci
- name: Setup BATS
uses: mig4/setup-bats@v1
with:
bats-version: 0.4.0 # This is the version i have locally. looks like an upgrade is in order, though…
- run: git submodule update --init
name: pull in bats assertion libs
- run: npm run lint
- run: npm run shellcheck
- run: npm run unit

View file

@ -1,17 +0,0 @@
language: node_js
node_js: "node"
cache:
directories:
- node_modules
before_install:
- git clone --depth 1 https://github.com/sstephenson/bats.git
install:
- npm install
script:
- npm run lint:package
- npm run lint:readme
- npm run lint:editorconfig
- npm run lint:man
- shellcheck git-open
- npm run man
- ./bats/bin/bats test/*.bats

View file

@ -32,7 +32,7 @@
},
"man": "./git-open.1",
"scripts": {
"lint:editorconfig": "eclint check git-open* readme* .travis.yml",
"lint:editorconfig": "eclint check ./git-open *.md *.yml",
"lint:readme": "markdownlint --config markdownlint.json README.md",
"lint:man": "markdownlint --config markdownlint.json git-open.1.md",
"man": "marked-man --version \"git-open $npm_package_version\" --manual \"Git manual\" --section 1 git-open.1.md > git-open.1",
@ -43,7 +43,9 @@
"lint": "npm run lint:readme && npm run lint:man && npm run lint:editorconfig",
"test": "npm run unit && npm run lint",
"watch": "find . -maxdepth 2 -iname '*bats' -o -iname 'git-open' | entr bats test/"
"watch": "find . -maxdepth 2 -iname '*bats' -o -iname 'git-open' | entr bats test/",
"prepublishOnly": "npm run man && npm run test"
},
"devDependencies": {
"eclint": "^2.1.0",