diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 316fd21..1f230b0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,42 +45,18 @@ jobs: skip-build-cache: true skip-pkg-cache: true - tests-on-windows: - name: Run unit tests on windows + test: + name: Run unit tests needs: golangci-lint - runs-on: windows-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Install Go - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GO_VERSION }} - - - name: Run unit tests - run: make.exe test-unit - - tests-on-macos: - name: Run unit tests on macos - needs: golangci-lint - runs-on: macos-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Install Go - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GO_VERSION }} - - - name: Run unit tests - run: make test-unit - - tests-on-unix: - name: Run unit tests on linux - needs: golangci-lint - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: [ + "macos-latest", + "ubuntu-latest", + "windows-latest" + ] + runs-on: ${{ matrix.os }} steps: - name: Checkout code uses: actions/checkout@v3 diff --git a/internal/sn/model.go b/internal/sn/model.go index e9b4e1b..19069ad 100644 --- a/internal/sn/model.go +++ b/internal/sn/model.go @@ -55,6 +55,7 @@ type Item struct { UpdatedAt string `json:"updated_at"` UUID uuid.UUID `json:"uuid"` } + type AppData struct { OrgStandardnotesSn map[string]string `json:"org.standardnotes.sn"` } diff --git a/internal/sn/utils.go b/internal/sn/utils.go index 5d7dde9..fafee82 100644 --- a/internal/sn/utils.go +++ b/internal/sn/utils.go @@ -18,7 +18,10 @@ import ( "github.com/danielnetop/notesnook-to-standardnotes/internal/time" ) -const numOfNotesPerFile = "NUM_OF_NOTES_PER_FILE" +const ( + numOfNotesPerFileVar = "NUM_OF_NOTES_PER_FILE" + numOfNotesPerFile = 500 +) var ( notebooks = make(map[string]notesnook.NotebookInfo, 0) @@ -194,9 +197,9 @@ func ProcessConversionAndSaveToFile(nooks []notesnook.Nook) error { storeDataInMaps(nook, tipTaps) } - numOfNotes, err := strconv.Atoi(os.Getenv(numOfNotesPerFile)) + numOfNotes, err := strconv.Atoi(os.Getenv(numOfNotesPerFileVar)) if err != nil { - numOfNotes = 200 + numOfNotes = numOfNotesPerFile } return splitAndStoreConvertedNotes(convertNotesnookToStandardNotes(nooks), numOfNotes, 1) diff --git a/internal/time/time.go b/internal/time/time.go index f84ac60..e9d3824 100644 --- a/internal/time/time.go +++ b/internal/time/time.go @@ -3,5 +3,5 @@ package time import "time" func MilliToTime(milli int64) string { - return time.UnixMilli(milli).UTC().Format("2006-01-02 15:04:05Z") + return time.UnixMilli(milli).UTC().Format("2006-01-02T15:04:05Z") } diff --git a/internal/time/time_test.go b/internal/time/time_test.go index d863945..66f47f4 100644 --- a/internal/time/time_test.go +++ b/internal/time/time_test.go @@ -13,7 +13,7 @@ func TestMilliToTime(t *testing.T) { }{ { milli: 1699404581000, - want: "2023-11-08 00:49:41Z", + want: "2023-11-08T00:49:41Z", }, } for _, tt := range tests {