Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# see https://github.com/sdras/awesome-actions for a good list of available action
name: Github-CI

on: [push, pull_request]
on:
push:
branches: [master, ci-*]
pull_request:
branches: [master]

jobs:

Expand All @@ -11,10 +15,16 @@ jobs:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
node-version: [10.x] # [8.x, 10.x]
# code-version: [stable, insiders]
include:
- os: ubuntu-latest
node-version: 12.x
- os: ubuntu-latest
node-version: 14.x

steps:
- uses: actions/checkout@v2
Expand Down
5,517 changes: 4,556 additions & 961 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/readTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ export function readGrammar(asPlist: boolean = false) {
const directiveYaml = fs.readFileSync(path.join(__dirname, '../template/directives.yaml'), 'utf8')

// read variables
const languages = yaml.safeLoad(languageYaml)
const directives = yaml.safeLoad(directiveYaml)
const languages = yaml.safeLoad(languageYaml) as {[key: string]: any}
const directives = yaml.safeLoad(directiveYaml) as {[key: string]: any}

// inject variables
// eslint-disable-next-line @typescript-eslint/camelcase
const inputYaml = jinja.renderString(templateYaml, { admonition_classes: directives['admonition_classes'], code_classes: directives['code_classes'], languages }).toString()
const grammar = yaml.safeLoad(inputYaml)
const grammar = yaml.safeLoad(inputYaml) as {[key: string]: any}
if (asPlist) {
return plist.build(grammar)
}
Expand All @@ -36,7 +36,7 @@ function getDefault(obj: any, name: any, defaultValue: any = null) {

export function readSnippets(asJson: boolean = false) {
const snippetsYaml = fs.readFileSync(path.join(__dirname, '../snippets/dir.template.yaml'), 'utf8')
const snippets = yaml.safeLoad(snippetsYaml)
const snippets = yaml.safeLoad(snippetsYaml) as {[key: string]: any}
const finalData: { [index: string]: any } = {}
for (const name in snippets) {
const data = snippets[name]
Expand Down
2 changes: 1 addition & 1 deletion src/test/runIntergration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function main() {
const extensionTestsPath = path.resolve(__dirname, './integration/index')

// Download VS Code, unzip it and run the integration test
await runTests({ extensionDevelopmentPath, extensionTestsPath })
await runTests({ extensionDevelopmentPath, extensionTestsPath, version: '1.47.0' })
} catch (err) {
console.error(err)
console.error('Failed to run tests')
Expand Down
2 changes: 1 addition & 1 deletion src/test/standalone/build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ suite('Build Tests', () => {

test('Build directives', () => {
const expected = fs.readFileSync(path.join(__dirname, '../../../syntaxes', 'myst.tmLanguage'), 'utf8')
const plistString = readGrammar(true)
const plistString = readGrammar(true) as string
assert.equal(sanitize(plistString), sanitize(expected))
})

Expand Down
10 changes: 5 additions & 5 deletions test_static/colorize-results/pr-57_myst.md.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
},
{
"c": "(",
"t": "text.html.markdown markup.fenced_code.block.markdown meta.embedded.block.python meta.function.python punctuation.definition.parameters.begin.python",
"t": "text.html.markdown markup.fenced_code.block.markdown meta.embedded.block.python meta.function.python meta.function.parameters.python punctuation.definition.parameters.begin.python",
"r": {
"dark_plus": "meta.embedded: #D4D4D4",
"light_plus": "meta.embedded: #000000",
Expand All @@ -67,7 +67,7 @@
},
{
"c": "x",
"t": "text.html.markdown markup.fenced_code.block.markdown meta.embedded.block.python meta.function.python meta.function.parameters.python variable.parameter.function.python",
"t": "text.html.markdown markup.fenced_code.block.markdown meta.embedded.block.python meta.function.python meta.function.parameters.python variable.parameter.function.language.python",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
Expand All @@ -78,7 +78,7 @@
},
{
"c": ")",
"t": "text.html.markdown markup.fenced_code.block.markdown meta.embedded.block.python meta.function.python punctuation.definition.parameters.end.python",
"t": "text.html.markdown markup.fenced_code.block.markdown meta.embedded.block.python meta.function.python meta.function.parameters.python punctuation.definition.parameters.end.python",
"r": {
"dark_plus": "meta.embedded: #D4D4D4",
"light_plus": "meta.embedded: #000000",
Expand Down Expand Up @@ -256,8 +256,8 @@
"c": "var",
"t": "text.html.markdown markup.fenced_code.block.markdown meta.embedded.block.javascript meta.var.expr.js meta.var-single-variable.expr.js meta.definition.variable.js variable.other.constant.js",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_plus": "variable.other.constant: #4FC1FF",
"light_plus": "variable.other.constant: #0070C1",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "variable: #9CDCFE"
Expand Down
2 changes: 1 addition & 1 deletion test_static/colorize-results/role-span_myst.md.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"t": "text.html.markdown meta.paragraph.markdown constant.character.escape.markdown",
"r": {
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #FF0000",
"light_plus": "constant.character.escape: #EE0000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "constant.character: #569CD6"
Expand Down
2 changes: 1 addition & 1 deletion test_static/failing-fixtures/readme.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
skipping these tests because they are failing on travis (both color python code)
skipping these tests because they are failing on CI (both color python code)
TODO work out why these are failing