From 6de2d8aa2d7ebb966b98221b66e6da8152ae2c6b Mon Sep 17 00:00:00 2001 From: zhenghaoz Date: Mon, 18 Nov 2024 19:51:00 +0800 Subject: [PATCH 1/2] remove Intel macOS support --- .circleci/config.yml | 41 ----------------------------- .github/workflows/build_release.yml | 3 +-- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 342b85159..a69b82f41 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -61,47 +61,6 @@ jobs: no_output_timeout: 20m command: go test -timeout 20m -v ./... - unit-test-macos: - macos: - xcode: 14.2.0 - working_directory: ~/repo - steps: - - checkout - - run: - name: Set up dataset - command: | - mkdir -p ~/.gorse/dataset - mkdir -p ~/.gorse/download - wget https://cdn.gorse.io/datasets/ml-100k.zip -P ~/.gorse/download - wget https://cdn.gorse.io/datasets/ml-1m.zip -P ~/.gorse/download - wget https://cdn.gorse.io/datasets/pinterest-20.zip -P ~/.gorse/download - wget https://cdn.gorse.io/datasets/frappe.zip -P ~/.gorse/download - wget https://cdn.gorse.io/datasets/ml-tag.zip -P ~/.gorse/download - wget https://cdn.gorse.io/datasets/criteo.zip -P ~/.gorse/download - unzip ~/.gorse/download/ml-100k.zip -d ~/.gorse/dataset - unzip ~/.gorse/download/ml-1m.zip -d ~/.gorse/dataset - unzip ~/.gorse/download/pinterest-20.zip -d ~/.gorse/dataset - unzip ~/.gorse/download/frappe.zip -d ~/.gorse/dataset - unzip ~/.gorse/download/ml-tag.zip -d ~/.gorse/dataset - unzip ~/.gorse/download/criteo.zip -d ~/.gorse/dataset - - run: - name: Install Go - command: brew install go - - restore_cache: - keys: - - go-mod-v4-{{ checksum "go.sum" }} - - run: - name: Install Dependencies - command: go mod download - - save_cache: - key: go-mod-v4-{{ checksum "go.sum" }} - paths: - - "/go/pkg/mod" - - run: - name: Run tests - no_output_timeout: 20m - command: go test -timeout 20m -v ./... -skip "TestPostgres|TestMySQL|TestMongo|TestRedis|TestClickHouse" - unit-test-windows: executor: win/server-2022 steps: diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index e16f1c8ea..6c94d9905 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -24,7 +24,7 @@ jobs: - name: Build release run: > gox -output="{{.OS}}/{{.Arch}}/{{.Dir}}" \ - -osarch='darwin/arm64 darwin/amd64 windows/arm64 windows/amd64 linux/arm64 linux/amd64' -ldflags=" + -osarch='darwin/arm64 windows/arm64 windows/amd64 linux/arm64 linux/amd64' -ldflags=" -X 'github.com/zhenghaoz/gorse/cmd/version.Version=$(git describe --tags $(git rev-parse HEAD))' -X 'github.com/zhenghaoz/gorse/cmd/version.GitCommit=$(git rev-parse HEAD)' -X 'github.com/zhenghaoz/gorse/cmd/version.BuildTime=$(date)'" ./... @@ -40,7 +40,6 @@ jobs: zip -j gorse_linux_arm64.zip linux/arm64/gorse-* zip -j gorse_windows_amd64.zip windows/amd64/gorse-* zip -j gorse_windows_arm64.zip windows/arm64/gorse-* - zip -j gorse_darwin_amd64.zip darwin/amd64/gorse-* zip -j gorse_darwin_arm64.zip darwin/arm64/gorse-* - name: Upload release From 6d29ebcdaff6a6ffc991a5e2e58bcafaed28f555 Mon Sep 17 00:00:00 2001 From: zhenghaoz Date: Mon, 18 Nov 2024 19:55:32 +0800 Subject: [PATCH 2/2] move Windows test to GitHub actions --- .circleci/config.yml | 41 ------------------------ .github/workflows/build_test.yml | 55 +++++++++++++++++++------------- 2 files changed, 33 insertions(+), 63 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a69b82f41..ebf25f8b0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -61,48 +61,7 @@ jobs: no_output_timeout: 20m command: go test -timeout 20m -v ./... - unit-test-windows: - executor: win/server-2022 - steps: - - checkout - - run: - name: Set up dataset - command: | - New-Item -Type Directory -Path ~/.gorse/dataset - New-Item -Type Directory -Path ~/.gorse/download - Invoke-WebRequest https://cdn.gorse.io/datasets/ml-100k.zip -OutFile ~/.gorse/download/ml-100k.zip - Invoke-WebRequest https://cdn.gorse.io/datasets/ml-1m.zip -OutFile ~/.gorse/download/ml-1m.zip - Invoke-WebRequest https://cdn.gorse.io/datasets/pinterest-20.zip -OutFile ~/.gorse/download/pinterest-20.zip - Invoke-WebRequest https://cdn.gorse.io/datasets/frappe.zip -OutFile ~/.gorse/download/frappe.zip - Invoke-WebRequest https://cdn.gorse.io/datasets/ml-tag.zip -OutFile ~/.gorse/download/ml-tag.zip - Invoke-WebRequest https://cdn.gorse.io/datasets/criteo.zip -OutFile ~/.gorse/download/criteo.zip - Expand-Archive ~/.gorse/download/ml-100k.zip -DestinationPath ~/.gorse/dataset - Expand-Archive ~/.gorse/download/ml-1m.zip -DestinationPath ~/.gorse/dataset - Expand-Archive ~/.gorse/download/pinterest-20.zip -DestinationPath ~/.gorse/dataset - Expand-Archive ~/.gorse/download/frappe.zip -DestinationPath ~/.gorse/dataset - Expand-Archive ~/.gorse/download/ml-tag.zip -DestinationPath ~/.gorse/dataset - Expand-Archive ~/.gorse/download/criteo.zip -DestinationPath ~/.gorse/dataset - - run: - name: Upgrade Go - command: choco upgrade golang -y - - restore_cache: - keys: - - go-mod-v4-{{ checksum "go.sum" }} - - run: - name: Install Dependencies - command: go mod download - - save_cache: - key: go-mod-v4-{{ checksum "go.sum" }} - paths: - - "/go/pkg/mod" - - run: - name: Run tests - no_output_timeout: 20m - command: go test -timeout 20m -v ./... -skip "TestPostgres|TestMySQL|TestMongo|TestRedis|TestClickHouse" - workflows: unit-test: jobs: - unit-test-arm64 - - unit-test-macos - - unit-test-windows diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index e51acae1e..89deb6cad 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -92,17 +92,6 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v2 - - name: Get dependencies - run: | - go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure - fi - - - name: Build - run: go build -v ./... - - name: Test run: go test -timeout 20m -v ./... -coverprofile=coverage.txt -covermode=atomic env: @@ -120,8 +109,8 @@ jobs: - name: Upload run: bash <(curl -s https://codecov.io/bash) - unit_test_m1: - name: unit tests (M1) + unit_test_macos: + name: unit tests (macOS) runs-on: macos-latest steps: - name: Set up dataset @@ -150,16 +139,38 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v2 - - name: Get dependencies + - name: Test + run: go test -timeout 20m -v ./... -skip "TestPostgres|TestMySQL|TestMongo|TestRedis|TestClickHouse" + + unit_test_windows: + name: unit tests (Windows) + runs-on: windows-latest + steps: + - name: Set up dataset run: | - go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure - fi - - - name: Build - run: go build -v ./... + New-Item -Type Directory -Path ~/.gorse/dataset + New-Item -Type Directory -Path ~/.gorse/download + Invoke-WebRequest https://cdn.gorse.io/datasets/ml-100k.zip -OutFile ~/.gorse/download/ml-100k.zip + Invoke-WebRequest https://cdn.gorse.io/datasets/ml-1m.zip -OutFile ~/.gorse/download/ml-1m.zip + Invoke-WebRequest https://cdn.gorse.io/datasets/pinterest-20.zip -OutFile ~/.gorse/download/pinterest-20.zip + Invoke-WebRequest https://cdn.gorse.io/datasets/frappe.zip -OutFile ~/.gorse/download/frappe.zip + Invoke-WebRequest https://cdn.gorse.io/datasets/ml-tag.zip -OutFile ~/.gorse/download/ml-tag.zip + Invoke-WebRequest https://cdn.gorse.io/datasets/criteo.zip -OutFile ~/.gorse/download/criteo.zip + Expand-Archive ~/.gorse/download/ml-100k.zip -DestinationPath ~/.gorse/dataset + Expand-Archive ~/.gorse/download/ml-1m.zip -DestinationPath ~/.gorse/dataset + Expand-Archive ~/.gorse/download/pinterest-20.zip -DestinationPath ~/.gorse/dataset + Expand-Archive ~/.gorse/download/frappe.zip -DestinationPath ~/.gorse/dataset + Expand-Archive ~/.gorse/download/ml-tag.zip -DestinationPath ~/.gorse/dataset + Expand-Archive ~/.gorse/download/criteo.zip -DestinationPath ~/.gorse/dataset + + - name: Set up Go 1.23.x + uses: actions/setup-go@v4 + with: + go-version: 1.23.x + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 - name: Test run: go test -timeout 20m -v ./... -skip "TestPostgres|TestMySQL|TestMongo|TestRedis|TestClickHouse"