Skip to content

Commit f07edef

Browse files
authored
Add flag --src.schema (#326)
* Support for --src.schema in commands "slq", "sql", and "inspect"
1 parent 3735e80 commit f07edef

File tree

121 files changed

+42960
-1273
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+42960
-1273
lines changed

.github/workflows/codacy.yml

+1-20
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,8 @@
1414
name: Codacy Security Scan
1515

1616
on:
17-
# push:
18-
# branches: [ "master" ]
19-
# paths-ignore:
20-
# - '**.md'
21-
# - 'sq.json' # This is updated by scoop; no need to run a new build
22-
# - '.github/**'
23-
# pull_request:
24-
# # The branches below must be a subset of the branches above
25-
# branches: [ "master" ]
26-
# paths-ignore:
27-
# - '**.md'
28-
# - 'sq.json' # This is updated by scoop; no need to run a new build
29-
# - '.github/**'
3017
schedule:
3118
- cron: '43 3 * * 0'
32-
paths-ignore:
33-
- 'grammar/grun/**'
34-
- 'cli/testdata/*.rb'
35-
- 'magefile.go'
36-
# jcolorenc has a bunch of "unsafe" stuff in it
37-
- 'cli/output/jsonw/internal/jcolorenc/**'
3819

3920
permissions:
4021
contents: read
@@ -64,7 +45,7 @@ jobs:
6445
6546
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
6647
- name: Run Codacy Analysis CLI
67-
uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b
48+
uses: codacy/codacy-analysis-cli-action@master
6849
with:
6950
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
7051
# You can also omit the token and run the tools that support default configurations

.github/workflows/main.yml

+70-74
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ env:
1212
GO_VERSION: 1.21.0
1313
GORELEASER_VERSION: 1.20.0
1414
GOLANGCI_LINT_VERSION: v1.54.1
15+
TPARSE_VERSION: v0.11.1
1516
BUILD_TAGS: 'sqlite_vtable sqlite_stat4 sqlite_fts5 sqlite_introspect sqlite_json sqlite_math_functions'
1617

1718
jobs:
@@ -24,41 +25,36 @@ jobs:
2425

2526
steps:
2627
- name: Checkout
27-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2829
with:
2930
fetch-depth: 0
3031

3132
- name: Set up Go
3233
uses: actions/setup-go@v4
3334
with:
34-
go-version: ${{ env.GO_VERSION }}
35-
36-
# Install gotestfmt on the VM running the action.
37-
- name: Set up gotestfmt
38-
uses: gotesttools/gotestfmt-action@v2
39-
with:
40-
# Optional: pass GITHUB_TOKEN to avoid rate limiting.
41-
token: ${{ secrets.GITHUB_TOKEN }}
35+
go-version-file: go.mod
4236

4337

4438
- name: Build
4539
run: go build -tags '${{ env.BUILD_TAGS }}' -v ./...
4640

47-
# Run tests with nice formatting. Save the original log in /tmp/gotest.log
48-
# https://github.com/GoTestTools/gotestfmt#github-actions
49-
- name: Run tests
41+
- name: 'Go tests'
42+
shell: bash
5043
run: |
51-
set -euo pipefail
52-
go test -tags '${{ env.BUILD_TAGS }}' -json -v ./... 2>&1 | tee gotest.log | gotestfmt
44+
set -e
5345
54-
# Upload the original go test log as an artifact for later review.
55-
- name: Upload test log
56-
uses: actions/upload-artifact@v3
46+
# We tee the go test output to a file, so that "tparse" can
47+
# render pretty output below.
48+
go test -tags '${{ env.BUILD_TAGS }}' -timeout 20m -v -json -cover ./... | tee gotest.out.json
49+
50+
- name: 'Test output'
5751
if: always()
58-
with:
59-
name: test-log
60-
path: gotest.log
61-
if-no-files-found: warn
52+
shell: bash
53+
run: |
54+
set -e
55+
go install github.com/mfridman/tparse@${{ env.TPARSE_VERSION }}
56+
tparse -all -sort=elapsed -file gotest.out.json
57+
6258
6359
test-windows:
6460
runs-on: windows-2022
@@ -72,84 +68,84 @@ jobs:
7268
# path-type: inherit
7369

7470
- name: Checkout
75-
uses: actions/checkout@v3
71+
uses: actions/checkout@v4
7672
with:
7773
fetch-depth: 0
7874

7975
- name: Set up Go
80-
uses: actions/setup-go@v3
76+
uses: actions/setup-go@v4
8177
with:
82-
go-version: ${{ env.GO_VERSION }}
78+
go-version-file: go.mod
8379

8480
- name: Build
8581
run: go build -tags '${{ env.BUILD_TAGS }}' -v ./...
8682
# shell: msys2 {0}
8783

88-
- name: Run tests
84+
# - name: Run tests
85+
# run: |
86+
# go test -tags '${{ env.BUILD_TAGS }}' -v ./...
87+
## shell: msys2 {0}
88+
89+
- name: 'Go tests'
90+
shell: bash
8991
run: |
90-
go test -tags '${{ env.BUILD_TAGS }}' -v ./...
91-
# shell: msys2 {0}
92+
# set -e
93+
94+
# We send the Go test output to a file, so that "tparse" can
95+
# render pretty output below.
96+
go test -tags '${{ env.BUILD_TAGS }}' -timeout 20m -v -json -cover ./... > gotest.out.json
9297
93-
go-lint:
98+
- name: 'Test output'
99+
if: always()
100+
shell: bash
101+
run: |
102+
set -e
103+
go install github.com/mfridman/tparse@${{ env.TPARSE_VERSION }}
104+
tparse -all -sort=elapsed -file gotest.out.json
105+
106+
lint:
94107
runs-on: ubuntu-22.04
95108
steps:
96109
- name: Checkout
97-
uses: actions/checkout@v3
110+
uses: actions/checkout@v4
98111
with:
99112
fetch-depth: 0
100113

114+
- name: Lint GH workflow files
115+
run: |
116+
# From https://github.com/rhysd/actionlint
117+
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
118+
./actionlint -color
119+
120+
- name: shellcheck
121+
run: |
122+
shellcheck ./install.sh
123+
101124
- name: Set up Go
102-
uses: actions/setup-go@v3
125+
uses: actions/setup-go@v4
103126
with:
104-
go-version: ${{ env.GO_VERSION }}
127+
go-version-file: go.mod
105128

106129
- name: golangci-lint
107130
uses: golangci/golangci-lint-action@v3
108131
with:
109132
version: ${{ env.GOLANGCI_LINT_VERSION }}
110133

111-
# coverage:
112-
# runs-on: ubuntu-22.04
113-
# steps:
114-
# - name: Checkout
115-
# uses: actions/checkout@v3
116-
# with:
117-
# fetch-depth: 0
118-
#
119-
# - name: Set up Go
120-
# uses: actions/setup-go@v3
121-
# with:
122-
# go-version: ${{ env.GO_VERSION }}
123-
#
124-
# - name: Test
125-
# run: go test -v ./...
126-
#
127-
# # https://github.com/ncruces/go-coverage-report
128-
# - name: Update coverage report
129-
# uses: ncruces/go-coverage-report@v0
130-
# with:
131-
# report: 'true'
132-
# chart: 'true'
133-
# amend: 'false'
134-
# if: |
135-
# github.event_name == 'push'
136-
# continue-on-error: true
137-
138134

139135
binaries-darwin:
140136
if: startsWith(github.ref, 'refs/tags/v')
141137
runs-on: macos-12
142138

143139
steps:
144140
- name: Checkout
145-
uses: actions/checkout@v3
141+
uses: actions/checkout@v4
146142
with:
147143
fetch-depth: 0
148144

149145
- name: Set up Go
150-
uses: actions/setup-go@v3
146+
uses: actions/setup-go@v4
151147
with:
152-
go-version: ${{ env.GO_VERSION }}
148+
go-version-file: go.mod
153149

154150
- name: GoReleaser (build darwin binaries)
155151
uses: goreleaser/goreleaser-action@v3
@@ -173,14 +169,14 @@ jobs:
173169

174170
steps:
175171
- name: Checkout
176-
uses: actions/checkout@v3
172+
uses: actions/checkout@v4
177173
with:
178174
fetch-depth: 0
179175

180176
- name: Set up Go
181-
uses: actions/setup-go@v3
177+
uses: actions/setup-go@v4
182178
with:
183-
go-version: ${{ env.GO_VERSION }}
179+
go-version-file: go.mod
184180

185181
- name: GoReleaser (build linux-amd64 binaries)
186182
uses: goreleaser/goreleaser-action@v3
@@ -204,14 +200,14 @@ jobs:
204200

205201
steps:
206202
- name: Checkout
207-
uses: actions/checkout@v3
203+
uses: actions/checkout@v4
208204
with:
209205
fetch-depth: 0
210206

211207
- name: Set up Go
212-
uses: actions/setup-go@v3
208+
uses: actions/setup-go@v4
213209
with:
214-
go-version: ${{ env.GO_VERSION }}
210+
go-version-file: go.mod
215211

216212
- name: Install toolchain dependencies
217213
run: |
@@ -241,14 +237,14 @@ jobs:
241237

242238
steps:
243239
- name: Checkout
244-
uses: actions/checkout@v3
240+
uses: actions/checkout@v4
245241
with:
246242
fetch-depth: 0
247243

248244
- name: Set up Go
249-
uses: actions/setup-go@v3
245+
uses: actions/setup-go@v4
250246
with:
251-
go-version: ${{ env.GO_VERSION }}
247+
go-version-file: go.mod
252248

253249
- name: GoReleaser (build windows binaries)
254250
uses: goreleaser/goreleaser-action@v3
@@ -271,7 +267,7 @@ jobs:
271267
runs-on: ubuntu-22.04
272268
if: startsWith(github.ref, 'refs/tags/v')
273269
needs:
274-
- go-lint
270+
- lint
275271
- test-linux-darwin
276272
- test-windows
277273
- binaries-darwin
@@ -280,14 +276,14 @@ jobs:
280276
- binaries-windows
281277
steps:
282278
- name: Checkout
283-
uses: actions/checkout@v3
279+
uses: actions/checkout@v4
284280
with:
285281
fetch-depth: 0
286282

287283
- name: Set up Go
288-
uses: actions/setup-go@v3
284+
uses: actions/setup-go@v4
289285
with:
290-
go-version: ${{ env.GO_VERSION }}
286+
go-version-file: go.mod
291287

292288
- name: Download darwin artifacts
293289
uses: actions/download-artifact@v3

0 commit comments

Comments
 (0)