Skip to content

Commit

Permalink
fix(ci): fix ci (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
XdpCs authored Aug 6, 2024
1 parent 2bc01b0 commit cb57f7f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 61 deletions.
67 changes: 6 additions & 61 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- master
- main
- develop
paths:
- "**/*.go"
Expand All @@ -28,13 +28,9 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: ["1.20",1.21,1.22]
go-version: ['1.20']
runs-on: ubuntu-latest
services:
redis:
image: redis:latest
ports:
- 6379:6379
memcached:
image: memcached:latest
ports:
Expand Down Expand Up @@ -66,62 +62,11 @@ jobs:
with:
fetch-depth: 0

- name: Run etcd
env:
ETCD_VERSION: v3.4.16
run: |
rm -rf /tmp/etcd-data.tmp
mkdir -p /tmp/etcd-data.tmp
docker rmi gcr.io/etcd-development/etcd:${ETCD_VERSION} || true && \
docker run -d \
-p 2379:2379 \
-p 2380:2380 \
--mount type=bind,source=/tmp/etcd-data.tmp,destination=/etcd-data \
--name etcd-gcr-${ETCD_VERSION} \
gcr.io/etcd-development/etcd:${ETCD_VERSION} \
/usr/local/bin/etcd \
--name s1 \
--data-dir /etcd-data \
--listen-client-urls http://0.0.0.0:2379 \
--advertise-client-urls http://0.0.0.0:2379 \
--listen-peer-urls http://0.0.0.0:2380 \
--initial-advertise-peer-urls http://0.0.0.0:2380 \
--initial-cluster s1=http://0.0.0.0:2380 \
--initial-cluster-token tkn \
--initial-cluster-state new
docker exec etcd-gcr-${ETCD_VERSION} /bin/sh -c "ETCDCTL_API=3 /usr/local/bin/etcdctl put current.float 1.23"
docker exec etcd-gcr-${ETCD_VERSION} /bin/sh -c "ETCDCTL_API=3 /usr/local/bin/etcdctl put current.bool true"
docker exec etcd-gcr-${ETCD_VERSION} /bin/sh -c "ETCDCTL_API=3 /usr/local/bin/etcdctl put current.int 11"
docker exec etcd-gcr-${ETCD_VERSION} /bin/sh -c "ETCDCTL_API=3 /usr/local/bin/etcdctl put current.string hello"
docker exec etcd-gcr-${ETCD_VERSION} /bin/sh -c "ETCDCTL_API=3 /usr/local/bin/etcdctl put current.serialize.name test"
docker exec etcd-gcr-${ETCD_VERSION} /bin/sh -c "ETCDCTL_API=3 /usr/local/bin/etcdctl put sub.sub.key1 sub.sub.key"
- name: Run ORM tests on sqlite3
env:
GOPATH: /home/runner/go
ORM_DRIVER: sqlite3
ORM_SOURCE: /tmp/sqlite3/orm_test.db
run: |
mkdir -p /tmp/sqlite3 && touch /tmp/sqlite3/orm_test.db
go test -coverprofile=coverage_sqlite3.txt -covermode=atomic $(go list ./... | grep client/orm)
- name: Run ORM tests on postgres
env:
GOPATH: /home/runner/go
ORM_DRIVER: postgres
ORM_SOURCE: host=localhost port=${{ job.services.postgres.ports[5432] }} user=postgres password=postgres dbname=orm_test sslmode=disable
run: |
go test -coverprofile=coverage_postgres.txt -covermode=atomic $(go list ./... | grep client/orm)
- name: "run go build"
run: go build -v ./...

- name: Run tests on mysql
env:
GOPATH: /home/runner/go
ORM_DRIVER: mysql
ORM_SOURCE: root:root@/orm_test?charset=utf8
run: |
sudo systemctl start mysql
mysql -u root -proot -e 'create database orm_test;'
go test -coverprofile=coverage.txt -covermode=atomic ./...
- name: "run go test and out codecov"
run: go test -v ./... -race -coverprofile=coverage.out -covermode=atomic

- name: Upload codecov
env:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# beego-session-ext

Some Session implementations that are not frequently used.

0 comments on commit cb57f7f

Please sign in to comment.