Skip to content

Commit fcf8b73

Browse files
authored
Merge pull request commonmark#226 from github/add-ci
Move CI build over to Actions, per `@jgm`'s upstream work.
2 parents 85d8952 + 0277638 commit fcf8b73

File tree

3 files changed

+86
-4
lines changed

3 files changed

+86
-4
lines changed

.github/workflows/ci.yml

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: CI tests
2+
3+
on: [push, workflow_dispatch]
4+
5+
jobs:
6+
linux:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
cmake_opts:
13+
- '-DCMARK_SHARED=ON'
14+
- ''
15+
compiler:
16+
- c: 'clang'
17+
cpp: 'clang++'
18+
- c: 'gcc'
19+
cpp: 'g++'
20+
env:
21+
CMAKE_OPTIONS: ${{ matrix.cmake_opts }}
22+
CC: ${{ matrix.compiler.c }}
23+
CXX: ${{ matrix.compiler.cpp }}
24+
25+
steps:
26+
- uses: actions/checkout@v1
27+
- name: Install valgrind
28+
run: |
29+
sudo apt install -y valgrind
30+
- name: Build and test
31+
run: |
32+
make
33+
make test
34+
make leakcheck
35+
36+
macos:
37+
38+
runs-on: macOS-latest
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
cmake_opts:
43+
- '-DCMARK_SHARED=ON'
44+
- ''
45+
compiler:
46+
- c: 'clang'
47+
cpp: 'clang++'
48+
- c: 'gcc'
49+
cpp: 'g++'
50+
env:
51+
CMAKE_OPTIONS: ${{ matrix.cmake_opts }}
52+
CC: ${{ matrix.compiler.c }}
53+
CXX: ${{ matrix.compiler.cpp }}
54+
55+
steps:
56+
- uses: actions/checkout@v1
57+
- name: Build and test
58+
env:
59+
CMAKE_OPTIONS: -DCMARK_SHARED=OFF
60+
run: |
61+
make
62+
make test
63+
64+
windows:
65+
66+
runs-on: windows-latest
67+
strategy:
68+
fail-fast: false
69+
matrix:
70+
cmake_opts:
71+
- '-DCMARK_SHARED=ON'
72+
- ''
73+
env:
74+
CMAKE_OPTIONS: ${{ matrix.cmake_opts }}
75+
76+
steps:
77+
- uses: actions/checkout@v1
78+
- uses: ilammy/msvc-dev-cmd@v1
79+
- name: Build and test
80+
run: |
81+
chcp 65001
82+
nmake.exe /nologo /f Makefile.nmake test
83+
shell: cmd

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
cmark-gfm
22
=========
33

4-
[![Build Status]](https://travis-ci.org/github/cmark-gfm)
5-
[![Windows Build Status]](https://ci.appveyor.com/project/github/cmark)
4+
![Actions CI](https://github.com/github/cmark-gfm/actions/workflows/ci.yml/badge.svg)
65

76
`cmark-gfm` is an extended version of the C reference implementation of
87
[CommonMark], a rationalized version of Markdown syntax with a spec. This

test/normalize.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- coding: utf-8 -*-
22
from html.parser import HTMLParser
33
import urllib
4+
import html
45

56
try:
67
from html.parser import HTMLParseError
@@ -13,7 +14,6 @@ class HTMLParseError(Exception):
1314
from html.entities import name2codepoint
1415
import sys
1516
import re
16-
import cgi
1717

1818
# Normalization code, adapted from
1919
# https://github.com/karlcow/markdown-testsuite/
@@ -66,7 +66,7 @@ def handle_starttag(self, tag, attrs):
6666
self.output += ("=" + '"' +
6767
urllib.quote(urllib.unquote(v), safe='/') + '"')
6868
elif v != None:
69-
self.output += ("=" + '"' + cgi.escape(v,quote=True) + '"')
69+
self.output += ("=" + '"' + html.escape(v,quote=True) + '"')
7070
self.output += ">"
7171
self.last_tag = tag
7272
self.last = "starttag"

0 commit comments

Comments
 (0)