Skip to content

Commit 96f46b2

Browse files
authored
Add CI (#2)
We need to use X11 to run vscode. The [Azure Pipelines example][0] isn't quite correct for CircleCI, luckily I found this [working circleci config][1]. [0]: https://code.visualstudio.com/api/working-with-extensions/continuous-integration [1]: https://github.com/joequery/Stupid-Table-Plugin/blob/master/.circleci/config.yml
1 parent fea47f1 commit 96f46b2

12 files changed

Lines changed: 123 additions & 84 deletions

‎.circleci/config.yml‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Javascript Node CircleCI 2.0 configuration file
2+
#
3+
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
4+
#
5+
version: 2
6+
jobs:
7+
build:
8+
docker:
9+
- image: circleci/node:11.5.0
10+
11+
working_directory: ~/repo
12+
13+
steps:
14+
- checkout
15+
- restore_cache:
16+
keys:
17+
- v1-dependencies-{{ checksum "package.json" }}
18+
# fallback to using the latest cache if no exact match is found
19+
- v1-dependencies-
20+
21+
- run:
22+
name: install
23+
command: |
24+
make install
25+
sudo apt install libgtk-3-0 libxss1 libnss3 libasound2
26+
- save_cache:
27+
paths:
28+
- node_modules
29+
key: v1-dependencies-{{ checksum "package.json" }}
30+
- run:
31+
name: configure X11
32+
command: |
33+
set -e
34+
/usr/bin/Xvfb :10 -ac
35+
background: true
36+
- run:
37+
name: test
38+
command: DISPLAY=':10' make test-ci

‎.prettierignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.vscode-test
2+
node_modules
3+
out

‎.prettierrc.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://prettier.io/docs/en/options.html
2+
semi = false
3+
trailingComma = "all"

‎CHANGELOG.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
# Changelog
2+
23
All notable changes to this project will be documented in this file.
34

45
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
56
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
67

78
## [Unreleased]
9+
810
### Added
11+
912
- `githubinator.enable_context_menu` option to disable/enable access to githubinator in the context menu.
1013

1114
## 0.1.0 - 2019-02-28
15+
1216
### Added
17+
1318
- Basic extension with github support

‎Makefile‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.PHONY: install, lint, format, format-ci, test
2+
3+
install:
4+
@yarn install
5+
lint:
6+
@yarn lint
7+
format:
8+
@yarn format
9+
format-ci:
10+
@yarn format:ci
11+
test-ci: lint, format-ci
12+
@yarn vscode:prepublish
13+
@yarn test

‎README.md‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ With `vsce` installed from NPM (`yarn global add vsce`), clone [this repo](https
2727
### Commands
2828

2929
| command | copy URL | open URL | mode | SHA-type |
30-
| ------------------------------------- | :--------: | :--------: | --------- | -------------- |
31-
| `Githubinator` | | | blob | current branch |
32-
| `Githubinator: Copy` | | | blob | current branch |
33-
| `Githubinator: Copy Master` | | | blob | master branch |
34-
| `Githubinator: Copy Permalink` | | | blob | current SHA |
35-
| `Githubinator: Copy Master Permalink` | | | blob | master SHA |
36-
| `Githubinator: On Master` | | | blob | master branch |
37-
| `Githubinator: Permalink` | | | blob | current SHA |
38-
| `Githubinator: Blame` | | | blame | current branch |
39-
| `Githubinator: Blame On Master` | | | blame | master branch |
40-
| `Githubinator: Blame Permalink` | | | blame | current sha |
41-
| `Githubinator: Repository` | | | open repo | N/A |
30+
| ------------------------------------- | :------: | :------: | --------- | -------------- |
31+
| `Githubinator` | | | blob | current branch |
32+
| `Githubinator: Copy` | | | blob | current branch |
33+
| `Githubinator: Copy Master` | | | blob | master branch |
34+
| `Githubinator: Copy Permalink` | | | blob | current SHA |
35+
| `Githubinator: Copy Master Permalink` | | | blob | master SHA |
36+
| `Githubinator: On Master` | | | blob | master branch |
37+
| `Githubinator: Permalink` | | | blob | current SHA |
38+
| `Githubinator: Blame` | | | blame | current branch |
39+
| `Githubinator: Blame On Master` | | | blame | master branch |
40+
| `Githubinator: Blame Permalink` | | | blame | current sha |
41+
| `Githubinator: Repository` | | | open repo | N/A |
4242

4343
## Requirements
4444

@@ -70,10 +70,10 @@ Initial release
7070
This plugin is based on the [Sublime Plugin by ehamiter](https://github.com/ehamiter/GitHubinator) with the same name.
7171

7272
| project | providers | blame | history | permalink | master | copy | open | open-pr | one-step actions | provider autodetection |
73-
| ----------------------------------------------------------------------------- | --------------------------------------- | :-----: | :-------: | :---------: | :------: | :----: | :----: | :-------: | :----------------: | :----------------------: |
74-
| this project | Github | | | | | | | | | ||
75-
| [d4rkr00t/vscode-open-in-github][d4rkr00t-github] ([vscode][d4rkr00t-vscode]) | Github | | | | | | | | | |
76-
| [ziyasal/vscode-open-in-github][ziyasal-github] ([vscode][ziyasal-vscode]) | Github, Bitbucket, Gitlab, Visualstudio | | |\* | | | | | | |
73+
| ----------------------------------------------------------------------------- | --------------------------------------- | :---: | :-----: | :-------: | :----: | :--: | :--: | :-----: | :--------------: | :--------------------: |
74+
| this project | Github | | | | | | | | | |
75+
| [d4rkr00t/vscode-open-in-github][d4rkr00t-github] ([vscode][d4rkr00t-vscode]) | Github | | | | | | | | | |
76+
| [ziyasal/vscode-open-in-github][ziyasal-github] ([vscode][ziyasal-vscode]) | Github, Bitbucket, Gitlab, Visualstudio | | | \* || | | | | |
7777

7878
\* changeable in settings between permalink and branch
7979

‎package.json‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,10 @@
176176
"compile": "tsc -p ./",
177177
"watch": "tsc -watch -p ./",
178178
"postinstall": "node ./node_modules/vscode/bin/install",
179-
"test": "yarn run compile && node ./node_modules/vscode/bin/test"
179+
"lint": "yarn run tslint --project tsconfig.json",
180+
"test": "yarn run compile && node ./node_modules/vscode/bin/test",
181+
"format": "$(yarn bin)/prettier --write src/**/* .circleci/* *.md *.json",
182+
"format:ci": "$(yarn bin)/prettier --check src/**/* .circleci/* *.md *.json"
180183
},
181184
"devDependencies": {
182185
"@types/ini": "^1.3.30",

‎src/test/extension.test.ts‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎src/test/index.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
// to report the results back to the caller. When the tests are finished, return
1111
// a possible error to the callback or null if none.
1212

13-
import * as testRunner from "vscode/lib/testrunner";
13+
import * as testRunner from "vscode/lib/testrunner"
1414

1515
// You can directly control Mocha options by configuring the test runner below
1616
// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options
1717
// for more info
1818
testRunner.configure({
1919
ui: "tdd", // the TDD UI is being used in extension.test.ts (suite, test, etc.)
20-
useColors: true // colored output from test results
21-
});
20+
useColors: true, // colored output from test results
21+
})
2222

23-
module.exports = testRunner;
23+
module.exports = testRunner

‎src/test/providers.test.ts‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
import { Github } from "../providers";
2-
import * as assert from "assert";
1+
import { Github } from "../providers"
2+
import * as assert from "assert"
33

44
test("Github", () => {
5-
const gh = new Github();
5+
const gh = new Github()
66
test("ssh", () => {
77
const result = gh.getUrl({
88
origin: "git@github.com:recipeyak/recipeyak.git",
99
selection: [17, 24],
1010
mode: "blob",
1111
providersConfig: {},
1212
head: "db99a912f5c4bffe11d91e163cd78ed96589611b",
13-
relativeFilePath: "frontend/src/components/App.ts"
14-
});
13+
relativeFilePath: "frontend/src/components/App.ts",
14+
})
1515
assert.strictEqual(
1616
result,
17-
"https://github.com/recipeyak/recipeyak/blob/db99a912f5c4bffe11d91e163cd78ed96589611b/frontend/src/components/App.tsx#L17-L24"
18-
);
19-
});
17+
"https://github.com/recipeyak/recipeyak/blob/db99a912f5c4bffe11d91e163cd78ed96589611b/frontend/src/components/App.tsx#L17-L24",
18+
)
19+
})
2020
test("https", () => {
2121
const result = gh.getUrl({
2222
origin: "https://github.com/recipeyak/recipeyak.git",
2323
selection: [17, 24],
2424
mode: "blame",
2525
providersConfig: {},
2626
head: "db99a912f5c4bffe11d91e163cd78ed96589611b",
27-
relativeFilePath: "frontend/src/components/App.ts"
28-
});
27+
relativeFilePath: "frontend/src/components/App.ts",
28+
})
2929
assert.strictEqual(
3030
result,
31-
"https://github.com/recipeyak/recipeyak/blame/db99a912f5c4bffe11d91e163cd78ed96589611b/frontend/src/components/App.tsx#L17-L24"
32-
);
33-
});
34-
});
31+
"https://github.com/recipeyak/recipeyak/blame/db99a912f5c4bffe11d91e163cd78ed96589611b/frontend/src/components/App.tsx#L17-L24",
32+
)
33+
})
34+
})

0 commit comments

Comments
 (0)