diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb12dfa2..f468d73a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,7 +41,7 @@ jobs: - name: Upload artifacts windows-amd64 if: ${{ matrix.platform == 'windows-amd64' && matrix.build-os == 'ubuntu-latest' }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: exporter-windows-amd64 path: safetyculture-exporter-windows-x86_64.zip @@ -60,7 +60,7 @@ jobs: - name: Upload artifacts linux-amd64 if: ${{ matrix.platform == 'linux-amd64' && matrix.build-os == 'ubuntu-latest' }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: exporter-linux-amd64 path: safetyculture-exporter-linux-amd64.zip @@ -92,7 +92,7 @@ jobs: - name: Upload artifacts darwin-amd64 if: ${{ matrix.platform == 'darwin-amd64' && matrix.build-os == 'macOS-latest' }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: exporter-darwin-amd64 path: safetyculture-exporter-darwin-amd64.zip @@ -124,7 +124,7 @@ jobs: - name: Upload artifacts darwin-arm64 if: ${{ matrix.platform == 'darwin-arm64' && matrix.build-os == 'macOS-latest' }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: exporter-darwin-arm64 path: safetyculture-exporter-darwin-arm64.zip @@ -134,22 +134,22 @@ jobs: needs: package steps: - name: Download package windows amd64 - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: exporter-windows-amd64 - name: Download package darwin amd64 - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: exporter-darwin-amd64 - name: Download package darwin arm64 - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: exporter-darwin-arm64 - name: Download package linux amd64 - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: exporter-linux-amd64 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2ca50bd5..fd468f33 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,7 +32,7 @@ jobs: ./cc-test-reporter format-coverage -o codeclimate.json --prefix $(go list -m) - name: Upload Coverage Result Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: codeclimate-unit path: codeclimate.json @@ -81,7 +81,7 @@ jobs: ./cc-test-reporter format-coverage -o codeclimate.json --prefix $(go list -m) - name: Upload Coverage Result Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: codeclimate-intg-postgres path: codeclimate.json @@ -127,7 +127,7 @@ jobs: ./cc-test-reporter format-coverage -o codeclimate.json --prefix $(go list -m) - name: Upload Coverage Result Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: codeclimate-mysql-8 path: codeclimate.json @@ -143,10 +143,10 @@ jobs: SA_PASSWORD: "SafetyCultureExporter12345" ACCEPT_EULA: "Y" options: >- - --health-cmd "/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P SafetyCultureExporter12345 -Q \"SELECT 1\" || exit 1" + --health-cmd "/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P SafetyCultureExporter12345 -Q \"SELECT 1\" || exit 1" --health-interval 10s - --health-timeout 5s - --health-retries 5 + --health-timeout 10s + --health-retries 20 ports: - 1433:1433 @@ -172,7 +172,7 @@ jobs: ./cc-test-reporter format-coverage -o codeclimate.json --prefix $(go list -m) - name: Upload Coverage Result Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: codeclimate-intg-sql-server path: codeclimate.json @@ -187,7 +187,7 @@ jobs: - SQL-Server-Integration-Tests steps: - name: Download all coverage results - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 - name: Upload Coverage to Code Climate env: diff --git a/.gitignore b/.gitignore index bf733fbe..8e0f2b49 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,6 @@ dist/ .release-env /export/ -safetyculture-exporter.yaml +safetyculture-exporter*.yaml *.log perf.md diff --git a/Makefile b/Makefile index 3d884482..c592922d 100644 --- a/Makefile +++ b/Makefile @@ -17,3 +17,7 @@ soak-tests: TEST_API_HOST="https://api.safetyculture.io" TEST_DB_DIALECT="mysql" TEST_DB_CONN_STRING="root:safetyculture_exporter@tcp(localhost:3308)/safetyculture_exporter_db?charset=utf8mb4&parseTime=True&loc=Local" go test ./... -tags=soak TEST_API_HOST="https://api.safetyculture.io" TEST_DB_DIALECT="sqlserver" TEST_DB_CONN_STRING="sqlserver://sa:SafetyCultureExporter12345@localhost:1433?database=master" go test ./... -tags=soak TEST_API_HOST="https://api.safetyculture.io" TEST_DB_DIALECT="sqlite" TEST_DB_CONN_STRING="file::memory:" go test ./... -tags=soak + +.PHONY: start-local-mssql +start-local-mssql: + docker-compose -f docker-compose-local-volume.yml up sqlserver diff --git a/go.mod b/go.mod index c90c29cc..7837497b 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 - github.com/tidwall/gjson v1.17.1 + github.com/tidwall/gjson v1.17.3 github.com/tidwall/sjson v1.2.5 go.uber.org/zap v1.27.0 gopkg.in/h2non/gock.v1 v1.1.2 @@ -28,7 +28,7 @@ require ( gorm.io/driver/postgres v1.5.9 gorm.io/driver/sqlite v1.5.6 gorm.io/driver/sqlserver v1.5.3 - gorm.io/gorm v1.25.10 + gorm.io/gorm v1.25.12 ) require ( diff --git a/go.sum b/go.sum index 3f70ea5c..dfecdbf8 100644 --- a/go.sum +++ b/go.sum @@ -174,8 +174,8 @@ github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8 github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/gjson v1.17.1 h1:wlYEnwqAHgzmhNUFfw7Xalt2JzQvsMx2Se4PcoFCT/U= -github.com/tidwall/gjson v1.17.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.17.3 h1:bwWLZU7icoKRG+C+0PNwIKC6FCJO/Q3p2pZvuP0jN94= +github.com/tidwall/gjson v1.17.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= @@ -290,5 +290,5 @@ gorm.io/driver/sqlserver v1.5.3 h1:rjupPS4PVw+rjJkfvr8jn2lJ8BMhT4UW5FwuJY0P3Z0= gorm.io/driver/sqlserver v1.5.3/go.mod h1:B+CZ0/7oFJ6tAlefsKoyxdgDCXJKSgwS2bMOQZT0I00= gorm.io/gorm v1.25.7-0.20240204074919-46816ad31dde/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= -gorm.io/gorm v1.25.10 h1:dQpO+33KalOA+aFYGlK+EfxcI5MbO7EP2yYygwh9h+s= -gorm.io/gorm v1.25.10/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= +gorm.io/gorm v1.25.12 h1:I0u8i2hWQItBq1WfE0o2+WuL9+8L21K9e2HHSTE/0f8= +gorm.io/gorm v1.25.12/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ=