Skip to content

Commit 1df44a4

Browse files
committed
initialize htmlparser
1 parent c2b6aac commit 1df44a4

File tree

6 files changed

+2387
-0
lines changed

6 files changed

+2387
-0
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: htmlparser CI
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build:
6+
if: |
7+
!contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[skip ci]')
8+
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
branch: [devel]
13+
target:
14+
- os: linux
15+
cpu: amd64
16+
- os: linux
17+
cpu: i386
18+
- os: macos
19+
cpu: amd64
20+
- os: windows
21+
cpu: i386
22+
- os: windows
23+
cpu: amd64
24+
include:
25+
- target:
26+
os: linux
27+
builder: ubuntu-20.04
28+
- target:
29+
os: macos
30+
builder: macos-10.15
31+
- target:
32+
os: windows
33+
builder: windows-2019
34+
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (${{ matrix.branch }})'
35+
runs-on: ${{ matrix.builder }}
36+
37+
defaults:
38+
run:
39+
shell: bash
40+
working-directory: htmlparser
41+
42+
steps:
43+
- uses: actions/setup-node@v4
44+
- name: Checkout htmlparser
45+
uses: actions/checkout@v4
46+
with:
47+
path: htmlparser
48+
49+
# - name: Install dependencies (Linux amd64)
50+
# if: runner.os == 'Linux' && matrix.target.cpu == 'amd64'
51+
# run: |
52+
# sudo DEBIAN_FRONTEND='noninteractive' apt-fast install \
53+
# --no-install-recommends -yq <packages here>
54+
55+
- name: Install dependencies (Linux i386)
56+
if: runner.os == 'Linux' && matrix.target.cpu == 'i386'
57+
working-directory: ${{ github.workspace }}
58+
run: |
59+
sudo dpkg --add-architecture i386
60+
sudo apt-fast update -qq
61+
sudo DEBIAN_FRONTEND='noninteractive' apt-fast install \
62+
--no-install-recommends -yq gcc-multilib g++-multilib \
63+
libssl-dev:i386
64+
65+
mkdir -p external/bin
66+
cat << EOF > external/bin/gcc
67+
#!/bin/bash
68+
69+
exec $(which gcc) -m32 "\$@"
70+
EOF
71+
72+
cat << EOF > external/bin/g++
73+
#!/bin/bash
74+
75+
exec $(which g++) -m32 "\$@"
76+
EOF
77+
78+
chmod 755 external/bin/gcc external/bin/g++
79+
80+
echo "$PWD/external/bin" >> "${GITHUB_PATH}"
81+
82+
# - name: Install dependencies (macOS)
83+
# if: runner.os == 'macOS'
84+
# run: brew install <packages here>
85+
86+
- name: Install dependencies (Windows)
87+
if: runner.os == 'Windows'
88+
working-directory: ${{ github.workspace }}
89+
run: |
90+
mkdir external
91+
if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then
92+
arch=64
93+
else
94+
arch=32
95+
fi
96+
curl -L "https://nim-lang.org/download/mingw$arch.7z" -o "external/mingw$arch.7z"
97+
7z x "external/mingw$arch.7z" -oexternal/
98+
99+
cygpath -aw "external/mingw$arch/bin" >> "${GITHUB_PATH}"
100+
101+
- name: Setup Nim
102+
uses: alaviss/[email protected]
103+
with:
104+
path: nim
105+
version: ${{ matrix.branch }}
106+
architecture: ${{ matrix.target.cpu }}
107+
108+
- name: Run tests
109+
shell: bash
110+
run: testament all
111+
112+
- name: Build docs
113+
if: matrix.branch == 'master'
114+
run: nimble docs
115+
116+
- name: Deploy docs
117+
# to view docs on your own fork: push a gh-pages branch on your fork,
118+
# enable gh-pages in your fork
119+
# and remove `github.ref == 'refs/heads/master'` below
120+
if: |
121+
github.event_name == 'push' && github.ref == 'refs/heads/master' &&
122+
matrix.target.os == 'linux' && matrix.target.cpu == 'amd64' &&
123+
matrix.branch == 'master'
124+
uses: crazy-max/ghaction-github-pages@v4
125+
with:
126+
build_dir: htmlparser/htmldocs
127+
target_branch: gh-pages
128+
env:
129+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

htmlparser.nimble

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Package
2+
3+
version = "0.1.0"
4+
author = "ringabout"
5+
description = "Parse a HTML document in Nim."
6+
license = "MIT"
7+
srcDir = "src"
8+
9+
10+
# Dependencies
11+
12+
requires "nim >= 1.6.0"

0 commit comments

Comments
 (0)