Skip to content

Commit c8ae099

Browse files
committed
init parsesql
1 parent 6e55148 commit c8ae099

File tree

7 files changed

+2047
-0
lines changed

7 files changed

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

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
nimcache
2+
*.exe
3+
megatest.nim
4+
outputGotten.txt
5+
*.js
6+
htmldocs

parsesql.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 = "a high performance SQL file parser"
6+
license = "MIT"
7+
srcDir = "src"
8+
9+
10+
# Dependencies
11+
12+
requires "nim >= 2.0.0"

0 commit comments

Comments
 (0)