Use actions instead of drone
This commit is contained in:
parent
94fcec7f65
commit
631055f74a
16
.drone.yml
16
.drone.yml
|
@ -419,19 +419,3 @@ steps:
|
||||||
image: golang:1.17
|
image: golang:1.17
|
||||||
commands:
|
commands:
|
||||||
- make coverage
|
- make coverage
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: release-tag
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
steps:
|
|
||||||
- name: release-tag-gitea
|
|
||||||
pull: always
|
|
||||||
image: plugins/gitea-release:latest
|
|
||||||
settings:
|
|
||||||
base_url: https://gitea.com
|
|
||||||
title: '${DRONE_TAG} is released'
|
|
||||||
api_key:
|
|
||||||
from_secret: gitea_token
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
name: release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: setup go
|
||||||
|
uses: https://github.com/actions/setup-go@v4
|
||||||
|
with:
|
||||||
|
go-version: '>=1.20.1'
|
||||||
|
- name: Use Go Action
|
||||||
|
id: use-go-action
|
||||||
|
uses: actions/release-action@main
|
||||||
|
with:
|
||||||
|
api_key: '${{secrets.RELEASE_TOKEN}}'
|
|
@ -0,0 +1,67 @@
|
||||||
|
name: checks
|
||||||
|
on:
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
env:
|
||||||
|
GOPROXY: https://goproxy.io,direct
|
||||||
|
GOPATH: /go_path
|
||||||
|
GOCACHE: /go_cache
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: check and test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: cache go path
|
||||||
|
id: cache-go-path
|
||||||
|
uses: https://github.com/actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: /go_path
|
||||||
|
key: go_path-${{ github.repository }}-${{ github.ref_name }}
|
||||||
|
restore-keys: |
|
||||||
|
go_path-${{ github.repository }}-
|
||||||
|
go_path-
|
||||||
|
- name: cache go cache
|
||||||
|
id: cache-go-cache
|
||||||
|
uses: https://github.com/actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: /go_cache
|
||||||
|
key: go_cache-${{ github.repository }}-${{ github.ref_name }}
|
||||||
|
restore-keys: |
|
||||||
|
go_cache-${{ github.repository }}-
|
||||||
|
go_cache-
|
||||||
|
- uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: 1.20
|
||||||
|
- uses: https://github.com/actions/checkout@v3
|
||||||
|
- name: vet
|
||||||
|
run: make vet
|
||||||
|
- name: format check
|
||||||
|
run: make fmt-check
|
||||||
|
- name: unit test
|
||||||
|
run: make test
|
||||||
|
- name: test sqlite3
|
||||||
|
run: make test-sqlite3
|
||||||
|
- name: test sqlite3 with cache
|
||||||
|
run: TEST_CACHE_ENABLE=true make test-sqlite3
|
||||||
|
- name: test sqlite3 with quote policy
|
||||||
|
run: TEST_QUOTE_POLICY=reserved make test-sqlite
|
||||||
|
- name: test mysql
|
||||||
|
env:
|
||||||
|
TEST_MYSQL_HOST: mysql
|
||||||
|
TEST_MYSQL_CHARSET: utf8
|
||||||
|
TEST_MYSQL_DBNAME: xorm_test
|
||||||
|
TEST_MYSQL_USERNAME: root
|
||||||
|
TEST_MYSQL_PASSWORD:
|
||||||
|
run: TEST_CACHE_ENABLE=true make test-mysql
|
||||||
|
|
||||||
|
services:
|
||||||
|
mysql:
|
||||||
|
image: mysql:5.7
|
||||||
|
env:
|
||||||
|
MYSQL_ALLOW_EMPTY_PASSWORD: yes
|
||||||
|
MYSQL_DATABASE: xorm_test
|
||||||
|
ports:
|
||||||
|
- 3306:3306
|
||||||
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
Loading…
Reference in New Issue