From 0b626514bb3d752049c1ff8d3e8ed4a0ea5882c7 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Mon, 18 Jul 2022 14:19:56 -0700 Subject: [PATCH] move to github actions (#192) --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ .travis.yml | 17 ----------------- README.md | 8 ++++---- package.json | 6 ++++-- 4 files changed, 41 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6de38c7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e1e5fae..0000000 --- a/.travis.yml +++ /dev/null @@ -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 diff --git a/README.md b/README.md index d020a99..2f6834b 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,12 @@ git open [remote-name] [branch-name] git open --commit git open -c - # Open the current commit in the repo website + # Open the current commit in the repo website git open --issue git open -i - # If this branch is named like issue/#123, this will open the corresponding - # issue in the repo website + # If this branch is named like issue/#123, this will open the corresponding + # issue in the repo website git open --print git open -p @@ -93,7 +93,7 @@ for testing before adding it to your `.zshrc`. 1. `git clone https://github.com/paulirish/git-open.git $ZSH_CUSTOM/plugins/git-open` 1. Add `git-open` to your plugin list - edit `~/.zshrc` and change - `plugins=(...)` to `plugins=(... git-open)` + `plugins=(...)` to `plugins=(... git-open)` #### [Zgen](https://github.com/tarjoilija/zgen) diff --git a/package.json b/package.json index 3c6d90b..81f35ce 100644 --- a/package.json +++ b/package.json @@ -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",