Skip to content

Commit

Permalink
setup arm64 unit testing CircleCI (#668)
Browse files Browse the repository at this point in the history
(cherry picked from commit fb12092)
  • Loading branch information
zhenghaoz committed Mar 25, 2023
1 parent d94217f commit 5d4857e
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
version: 2.1

executors:
amd64:
machine:
image: ubuntu-2004:current
resource_class: large
arm64:
machine:
image: ubuntu-2004:current
resource_class: arm.large

jobs:
unit-test:
parameters:
platform:
type: executor
executor: << parameters.platform >>
working_directory: ~/repo
steps:
- checkout
- run:
name: Install Docker Compose
environment:
COMPOSE_VERSION: 'v2.17.1'
command: |
curl -L "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o ~/docker-compose
chmod +x ~/docker-compose
sudo mv ~/docker-compose /usr/local/bin/docker-compose
- run:
name: Set up databases
command: docker-compose up -d
working_directory: ./storage
- 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
- 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
command: go test -timeout 20m -v ./...

workflows:
unit-test:
jobs:
- unit-test:
matrix:
parameters:
platform: [amd64, arm64]

0 comments on commit 5d4857e

Please sign in to comment.