Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from packr to fs #667

Merged
merged 8 commits into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
23 changes: 13 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
name: Release

on:
create:
tags:
- v*.*.*
release:
types:
- published

jobs:
release:
name: Release
runs-on: ubuntu-latest
container:
image: bepsays/ci-goreleaser:1.15.1
steps:
- name: Checkout Code
uses: actions/checkout@master
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
fetch-depth: 0
go-version: 1.17
id: go

- name: Checkout Code
uses: actions/checkout@v2

- name: Fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
uses: goreleaser/goreleaser-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
with:
Expand Down
142 changes: 75 additions & 67 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
name: Tests
on: [push, pull_request]
on:
push:
branches:
- master
pull_request:

jobs:
mysql-tests:
name: MySQL tests
name: MySQL tests - Go v${{ matrix.go-version }}
runs-on: ubuntu-latest
strategy:
matrix:
go-version:
- "1.16.x"
- "1.17.x"

services:
mysql:
Expand All @@ -16,18 +26,12 @@ jobs:
options: --health-cmd "mysqladmin ping -h localhost" --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.15
id: go
- name: Checkout Code
uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v2
with:
fetch-depth: 1
- name: Get dependencies
run: |
go get -v -tags sqlite -t -d ./...
go-version: ${{ matrix.go-version }}

- name: Build and run soda
env:
SODA_DIALECT: "mysql"
Expand All @@ -37,20 +41,26 @@ jobs:
./tsoda drop -e $SODA_DIALECT -p ./testdata/migrations
./tsoda create -e $SODA_DIALECT -p ./testdata/migrations
./tsoda migrate -e $SODA_DIALECT -p ./testdata/migrations

- name: Test
env:
SODA_DIALECT: "mysql"
MYSQL_PORT: 3307
run: |
go test -tags sqlite -race ./...
go test -tags sqlite -race -cover ./...

pg-tests:
name: PostgreSQL tests
name: PostgreSQL tests - Go v${{ matrix.go-version }}
runs-on: ubuntu-latest
strategy:
matrix:
go-version:
- "1.16.x"
- "1.17.x"

services:
postgres:
image: postgres:10.8
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
Expand All @@ -61,18 +71,12 @@ jobs:
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.15
id: go
- name: Checkout Code
uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v2
with:
fetch-depth: 1
- name: Get dependencies
run: |
go get -v -tags sqlite -t -d ./...
go-version: ${{ matrix.go-version }}

- name: Build and run soda
env:
SODA_DIALECT: "postgres"
Expand All @@ -82,30 +86,30 @@ jobs:
./tsoda drop -e $SODA_DIALECT -p ./testdata/migrations
./tsoda create -e $SODA_DIALECT -p ./testdata/migrations
./tsoda migrate -e $SODA_DIALECT -p ./testdata/migrations

- name: Test
env:
SODA_DIALECT: "postgres"
POSTGRESQL_URL: "postgres://postgres:postgres@127.0.0.1:${{ job.services.postgres.ports[5432] }}/pop_test?sslmode=disable"
run: |
go test -tags sqlite -race ./...
go test -tags sqlite -race -cover ./...

crdbssl-tests:
name: Cockroach SSL tests
name: Cockroach SSL tests - Go v${{ matrix.go-version }}
runs-on: ubuntu-latest
strategy:
matrix:
go-version:
- "1.16.x"
- "1.17.x"

steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.15
id: go
- name: Checkout Code
uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v2
with:
fetch-depth: 1
- name: Get dependencies
run: |
go get -v -tags sqlite -t -d ./...
go-version: ${{ matrix.go-version }}

- name: Install Cockroach SSL
run: |
mkdir -p crdb/certs
Expand All @@ -117,6 +121,7 @@ jobs:
./cockroach cert create-node localhost 127.0.0.1 `hostname -s` `hostname -f` --certs-dir certs --ca-key key
./cockroach start-single-node --certs-dir certs --listen-addr localhost --port 26259 --http-port 8089 --background
popd

- name: Build and run soda
env:
SODA_DIALECT: "cockroach_ssl"
Expand All @@ -125,29 +130,29 @@ jobs:
./tsoda drop -e $SODA_DIALECT -p ./testdata/migrations
./tsoda create -e $SODA_DIALECT -p ./testdata/migrations
./tsoda migrate -e $SODA_DIALECT -p ./testdata/migrations

- name: Test
env:
SODA_DIALECT: "cockroach_ssl"
run: |
go test -tags sqlite -race ./...
go test -tags sqlite -race -cover ./...

crdb-tests:
name: Cockroach tests
runs-on: ubuntu-latest
strategy:
matrix:
go-version:
- "1.16.x"
- "1.17.x"

steps:
- name: Set up Go
uses: actions/setup-go@v1
- uses: actions/checkout@v2
- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v2
with:
go-version: 1.15
id: go
- name: Checkout Code
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Get dependencies
run: |
go get -v -tags sqlite -t -d ./...
go-version: ${{ matrix.go-version }}

- name: Install Cockroach
run: |
mkdir -p crdb
Expand All @@ -156,6 +161,7 @@ jobs:
mv cockroach-v20.2.4.linux-amd64/cockroach .
./cockroach start-single-node --insecure --background
popd

- name: Build and run soda
env:
SODA_DIALECT: "cockroach"
Expand All @@ -164,32 +170,33 @@ jobs:
./tsoda drop -e $SODA_DIALECT -p ./testdata/migrations
./tsoda create -e $SODA_DIALECT -p ./testdata/migrations
./tsoda migrate -e $SODA_DIALECT -p ./testdata/migrations

- name: Test
env:
SODA_DIALECT: "cockroach"
run: |
go test -tags sqlite -race ./...
go test -tags sqlite -race -cover ./...

sqlite-tests:
name: SQLite tests
name: SQLite tests ${{ matrix.os }} - Go v${{ matrix.go-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
go-version:
- "1.16.x"
- "1.17.x"
os:
- "macos-latest"
- "windows-latest"
- "ubuntu-latest"

steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.15
id: go
- name: Checkout Code
uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v2
with:
fetch-depth: 1
- name: Get dependencies
run: |
go get -v -tags sqlite -t -d ./...
go-version: ${{ matrix.go-version }}

- name: Build and run soda
env:
SODA_DIALECT: "sqlite"
Expand All @@ -199,8 +206,9 @@ jobs:
./tsoda create -e $SODA_DIALECT -p ./testdata/migrations
./tsoda migrate -e $SODA_DIALECT -p ./testdata/migrations
shell: bash

- name: Test
env:
SODA_DIALECT: "sqlite"
run: |
go test -tags sqlite -race ./...
go test -tags sqlite -race -cover ./...
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ run:
linters-settings:
govet:
# report about shadowed variables
check-shadowing: true
check-shadowing: true
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@ TAGS ?= "sqlite"
GO_BIN ?= go

install: deps
packr2
$(GO_BIN) install -tags ${TAGS} -v ./soda

deps:
$(GO_BIN) get github.com/gobuffalo/release
$(GO_BIN) get github.com/gobuffalo/packr/v2/packr2
$(GO_BIN) get -tags ${TAGS} -t ./...
ifeq ($(GO111MODULE),on)
$(GO_BIN) mod tidy
endif

build:
packr2
$(GO_BIN) build -v .

test:
# packr2
$(GO_BIN) test -tags ${TAGS} ./...

ci-test:
Expand All @@ -32,7 +28,6 @@ update:
ifeq ($(GO111MODULE),on)
$(GO_BIN) mod tidy
endif
packr2
make test
make install
ifeq ($(GO111MODULE),on)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p align="center"><img src="logo.png" width="150" height="150"></p>

<p align="center">
<a href="https://pkg.go.dev/github.com/gobuffalo/pop/v5"><img src="https://godoc.org/github.com/gobuffalo/pop?status.svg" alt="GoDoc" /></a>
<a href="https://pkg.go.dev/github.com/gobuffalo/pop/v6"><img src="https://godoc.org/github.com/gobuffalo/pop?status.svg" alt="GoDoc" /></a>
<a href="https://github.com/gobuffalo/pop/actions?query=workflow%3ATests+branch%3Amaster"><img src="https://github.com/gobuffalo/pop/workflows/Tests/badge.svg" alt="Build Status" /></a>
</p>

Expand Down
7 changes: 0 additions & 7 deletions SHOULDERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Pop does not try to reinvent the wheel! Instead, it uses the already great wheel

Thank you to the following **GIANTS**:


* [github.com/cockroachdb/apd](https://godoc.org/github.com/cockroachdb/apd)

* [github.com/cockroachdb/cockroach-go](https://godoc.org/github.com/cockroachdb/cockroach-go)
Expand All @@ -29,10 +28,6 @@ Thank you to the following **GIANTS**:

* [github.com/gobuffalo/nulls](https://godoc.org/github.com/gobuffalo/nulls)

* [github.com/gobuffalo/packd](https://godoc.org/github.com/gobuffalo/packd)

* [github.com/gobuffalo/packr/v2](https://godoc.org/github.com/gobuffalo/packr/v2)

* [github.com/gobuffalo/plush](https://godoc.org/github.com/gobuffalo/plush)

* [github.com/gobuffalo/validate](https://godoc.org/github.com/gobuffalo/validate)
Expand All @@ -55,8 +50,6 @@ Thank you to the following **GIANTS**:

* [github.com/mattn/go-sqlite3](https://godoc.org/github.com/mattn/go-sqlite3)

* [github.com/pkg/errors](https://godoc.org/github.com/pkg/errors)

* [github.com/satori/go.uuid](https://godoc.org/github.com/satori/go.uuid)

* [github.com/shopspring/decimal](https://godoc.org/github.com/shopspring/decimal)
Expand Down
2 changes: 1 addition & 1 deletion associations/association.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"

"github.com/gobuffalo/nulls"
"github.com/gobuffalo/pop/v5/columns"
"github.com/gobuffalo/pop/v6/columns"
)

// Association represents a definition of a model association
Expand Down
Loading