|
| 1 | +name: Go |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + |
| 7 | + test: |
| 8 | + name: Test |
| 9 | + runs-on: ${{ matrix.os }} |
| 10 | + defaults: |
| 11 | + run: |
| 12 | + shell: bash |
| 13 | + |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + os: [ubuntu-latest, macos-latest] |
| 17 | + go: ['1.19', '1.20', '1.21'] |
| 18 | + fail-fast: false |
| 19 | + env: |
| 20 | + OS: ${{ matrix.os }} |
| 21 | + GO: ${{ matrix.go }} |
| 22 | + steps: |
| 23 | + - if: startsWith(matrix.os, 'macos') |
| 24 | + run: brew update |
| 25 | + |
| 26 | + - uses: actions/setup-go@v2 |
| 27 | + with: |
| 28 | + go-version: ${{ matrix.go }} |
| 29 | + |
| 30 | + - name: Get Build Tools |
| 31 | + run: | |
| 32 | + GO111MODULE=on go install github.com/ory/go-acc@latest |
| 33 | +
|
| 34 | + - name: Add $GOPATH/bin to $PATH |
| 35 | + run: | |
| 36 | + echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH" |
| 37 | +
|
| 38 | + - uses: actions/checkout@v2 |
| 39 | + |
| 40 | + - name: 'Tags: default' |
| 41 | + run: go-acc . -- -race -v -tags "" |
| 42 | + |
| 43 | + - name: 'Tags: libsqlite3' |
| 44 | + run: go-acc . -- -race -v -tags "libsqlite3" |
| 45 | + |
| 46 | + - name: 'Tags: full' |
| 47 | + run: go-acc . -- -race -v -tags "sqlite_allow_uri_authority sqlite_app_armor sqlite_column_metadata sqlite_foreign_keys sqlite_fts5 sqlite_icu sqlite_introspect sqlite_json sqlite_math_functions sqlite_os_trace sqlite_preupdate_hook sqlite_secure_delete sqlite_see sqlite_stat4 sqlite_trace sqlite_unlock_notify sqlite_userauth sqlite_vacuum_incr sqlite_vtable" |
| 48 | + |
| 49 | + - name: 'Tags: vacuum' |
| 50 | + run: go-acc . -- -race -v -tags "sqlite_vacuum_full" |
| 51 | + |
| 52 | + - name: Upload coverage to Codecov |
| 53 | + uses: codecov/codecov-action@v1 |
| 54 | + with: |
| 55 | + env_vars: OS,GO |
| 56 | + file: coverage.txt |
| 57 | + |
| 58 | + test-windows: |
| 59 | + name: Test for Windows |
| 60 | + runs-on: windows-latest |
| 61 | + defaults: |
| 62 | + run: |
| 63 | + shell: bash |
| 64 | + |
| 65 | + strategy: |
| 66 | + matrix: |
| 67 | + go: ['1.19', '1.20', '1.21'] |
| 68 | + fail-fast: false |
| 69 | + env: |
| 70 | + OS: windows-latest |
| 71 | + GO: ${{ matrix.go }} |
| 72 | + steps: |
| 73 | + - uses: msys2/setup-msys2@v2 |
| 74 | + with: |
| 75 | + update: true |
| 76 | + install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-sqlite3 |
| 77 | + msystem: MINGW64 |
| 78 | + path-type: inherit |
| 79 | + |
| 80 | + - uses: actions/setup-go@v2 |
| 81 | + with: |
| 82 | + go-version: ${{ matrix.go }} |
| 83 | + |
| 84 | + - name: Add $GOPATH/bin to $PATH |
| 85 | + run: | |
| 86 | + echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH" |
| 87 | + shell: msys2 {0} |
| 88 | + |
| 89 | + - uses: actions/checkout@v2 |
| 90 | + |
| 91 | + - name: 'Tags: default' |
| 92 | + run: go build -race -v -tags "" |
| 93 | + shell: msys2 {0} |
| 94 | + |
| 95 | + - name: 'Tags: libsqlite3' |
| 96 | + run: go build -race -v -tags "libsqlite3" |
| 97 | + shell: msys2 {0} |
| 98 | + |
| 99 | + - name: 'Tags: full' |
| 100 | + run: | |
| 101 | + echo 'skip this test' |
| 102 | + echo go build -race -v -tags "sqlite_allow_uri_authority sqlite_app_armor sqlite_column_metadata sqlite_foreign_keys sqlite_fts5 sqlite_icu sqlite_introspect sqlite_json sqlite_math_functions sqlite_preupdate_hook sqlite_secure_delete sqlite_see sqlite_stat4 sqlite_trace sqlite_unlock_notify sqlite_userauth sqlite_vacuum_incr sqlite_vtable" |
| 103 | + shell: msys2 {0} |
| 104 | + |
| 105 | + - name: 'Tags: vacuum' |
| 106 | + run: go build -race -v -tags "sqlite_vacuum_full" |
| 107 | + shell: msys2 {0} |
| 108 | + |
| 109 | + - name: Upload coverage to Codecov |
| 110 | + uses: codecov/codecov-action@v2 |
| 111 | + with: |
| 112 | + env_vars: OS,GO |
| 113 | + file: coverage.txt |
| 114 | + |
| 115 | +# based on: github.com/koron-go/_skeleton/.github/workflows/go.yml |
0 commit comments