2020-08-25 07:56:34 +03:00
|
|
|
name: Go
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
test:
|
|
|
|
name: Test
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-08-25 08:24:45 +03:00
|
|
|
os: [ubuntu-latest, macos-latest]
|
2022-03-22 08:56:32 +03:00
|
|
|
go: ['1.16', '1.17', '1.18']
|
2020-08-25 07:56:34 +03:00
|
|
|
fail-fast: false
|
2020-08-25 12:13:57 +03:00
|
|
|
env:
|
|
|
|
OS: ${{ matrix.os }}
|
|
|
|
GO: ${{ matrix.go }}
|
2020-08-25 07:56:34 +03:00
|
|
|
steps:
|
2020-08-25 08:24:45 +03:00
|
|
|
- if: startsWith(matrix.os, 'macos')
|
|
|
|
run: brew update
|
2020-08-25 07:56:34 +03:00
|
|
|
|
2020-08-25 08:24:45 +03:00
|
|
|
- uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go }}
|
2020-08-25 07:56:34 +03:00
|
|
|
|
2020-08-25 08:24:45 +03:00
|
|
|
- name: Get Build Tools
|
|
|
|
run: |
|
2022-03-22 08:56:32 +03:00
|
|
|
GO111MODULE=on go install github.com/ory/go-acc
|
2020-08-25 07:56:34 +03:00
|
|
|
|
2020-08-25 08:24:45 +03:00
|
|
|
- name: Add $GOPATH/bin to $PATH
|
|
|
|
run: |
|
2020-11-17 18:34:04 +03:00
|
|
|
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
|
2020-08-25 07:56:34 +03:00
|
|
|
|
2020-08-25 08:24:45 +03:00
|
|
|
- uses: actions/checkout@v2
|
2020-08-25 07:56:34 +03:00
|
|
|
|
2020-08-25 08:24:45 +03:00
|
|
|
- name: 'Tags: default'
|
2020-08-25 12:13:57 +03:00
|
|
|
run: go-acc . -- -race -v -tags ""
|
2020-08-25 07:56:34 +03:00
|
|
|
|
2020-08-25 08:24:45 +03:00
|
|
|
- name: 'Tags: libsqlite3'
|
2020-08-25 12:13:57 +03:00
|
|
|
run: go-acc . -- -race -v -tags "libsqlite3"
|
2020-08-25 07:56:34 +03:00
|
|
|
|
2020-08-25 08:24:45 +03:00
|
|
|
- name: 'Tags: full'
|
2021-02-18 17:17:00 +03:00
|
|
|
run: go-acc . -- -race -v -tags "sqlite_allow_uri_authority sqlite_app_armor sqlite_foreign_keys sqlite_fts5 sqlite_icu sqlite_introspect sqlite_json sqlite_preupdate_hook sqlite_secure_delete sqlite_see sqlite_stat4 sqlite_trace sqlite_userauth sqlite_vacuum_incr sqlite_vtable sqlite_unlock_notify sqlite_column_metadata"
|
2020-08-25 07:56:34 +03:00
|
|
|
|
2020-08-25 08:24:45 +03:00
|
|
|
- name: 'Tags: vacuum'
|
2020-08-25 12:13:57 +03:00
|
|
|
run: go-acc . -- -race -v -tags "sqlite_vacuum_full"
|
|
|
|
|
|
|
|
- name: Upload coverage to Codecov
|
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
with:
|
|
|
|
env_vars: OS,GO
|
|
|
|
file: coverage.txt
|
2020-08-25 07:56:34 +03:00
|
|
|
|
|
|
|
test-windows:
|
|
|
|
name: Test for Windows
|
|
|
|
runs-on: windows-latest
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-03-22 08:56:32 +03:00
|
|
|
go: ['1.16', '1.17', '1.18']
|
2020-08-25 07:56:34 +03:00
|
|
|
fail-fast: false
|
2020-08-25 12:13:57 +03:00
|
|
|
env:
|
|
|
|
OS: windows-latest
|
|
|
|
GO: ${{ matrix.go }}
|
2020-08-25 07:56:34 +03:00
|
|
|
steps:
|
2020-08-25 08:24:45 +03:00
|
|
|
- uses: msys2/setup-msys2@v2
|
|
|
|
with:
|
|
|
|
update: true
|
|
|
|
install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-sqlite3
|
|
|
|
msystem: MINGW64
|
|
|
|
path-type: inherit
|
|
|
|
|
|
|
|
- uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go }}
|
|
|
|
|
|
|
|
- name: Add $GOPATH/bin to $PATH
|
|
|
|
run: |
|
2020-11-17 18:34:04 +03:00
|
|
|
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
|
2020-08-25 08:24:45 +03:00
|
|
|
shell: msys2 {0}
|
|
|
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2020-08-25 12:13:57 +03:00
|
|
|
- name: 'Tags: default'
|
2021-10-26 04:18:18 +03:00
|
|
|
run: go build -race -v -tags ""
|
2020-08-25 08:24:45 +03:00
|
|
|
shell: msys2 {0}
|
|
|
|
|
2020-08-25 12:13:57 +03:00
|
|
|
- name: 'Tags: libsqlite3'
|
2021-10-26 04:18:18 +03:00
|
|
|
run: go build -race -v -tags "libsqlite3"
|
2020-08-25 08:24:45 +03:00
|
|
|
shell: msys2 {0}
|
|
|
|
|
2020-08-25 12:13:57 +03:00
|
|
|
- name: 'Tags: full'
|
2020-08-25 08:24:45 +03:00
|
|
|
run: |
|
|
|
|
echo 'skip this test'
|
2021-10-26 04:18:18 +03:00
|
|
|
echo go build -race -v -tags "sqlite_allow_uri_authority sqlite_app_armor sqlite_foreign_keys sqlite_fts5 sqlite_icu sqlite_introspect sqlite_json sqlite_preupdate_hook sqlite_secure_delete sqlite_see sqlite_stat4 sqlite_trace sqlite_userauth sqlite_vacuum_incr sqlite_vtable sqlite_unlock_notify"
|
2020-08-25 08:24:45 +03:00
|
|
|
shell: msys2 {0}
|
|
|
|
|
2020-08-25 12:13:57 +03:00
|
|
|
- name: 'Tags: vacuum'
|
2021-10-26 04:18:18 +03:00
|
|
|
run: go build -race -v -tags "sqlite_vacuum_full"
|
2020-08-25 08:24:45 +03:00
|
|
|
shell: msys2 {0}
|
2020-08-25 07:56:34 +03:00
|
|
|
|
2020-08-25 12:13:57 +03:00
|
|
|
- name: Upload coverage to Codecov
|
2021-07-20 16:28:26 +03:00
|
|
|
uses: codecov/codecov-action@v2
|
2020-08-25 08:24:45 +03:00
|
|
|
with:
|
2020-08-25 12:13:57 +03:00
|
|
|
env_vars: OS,GO
|
|
|
|
file: coverage.txt
|
2020-08-25 08:24:45 +03:00
|
|
|
|
2020-08-25 07:56:34 +03:00
|
|
|
# based on: github.com/koron-go/_skeleton/.github/workflows/go.yml
|