refactor: move files to hrp

This commit is contained in:
debugtalk
2022-03-23 10:36:24 +08:00
parent 6cb835c6c6
commit 2187d41e65
122 changed files with 23288 additions and 23 deletions

45
.github/workflows/hrp-release.yml vendored Normal file
View File

@@ -0,0 +1,45 @@
name: Release hrp cli binaries
on:
release:
types: [created]
jobs:
releases-matrix:
name: Release hrp cli binaries
runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/amd64/windows
goos: [linux, windows, darwin]
goarch: [amd64, arm64]
exclude:
- goarch: arm64
goos: windows
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Release hrp cli binaries
uses: wangyoucao577/go-release-action@v1.23
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
project_path: "." # go build ./main.go
binary_name: "hrp"
ldflags: "-s -w"
extra_files: LICENSE README.md docs/CHANGELOG.md
post_command: |
echo "ASSET_PATH=$INPUT_PROJECT_PATH/$BUILD_ARTIFACTS_FOLDER/$RELEASE_ASSET_FILE" >> $GITHUB_ENV
- name: Setup aliyun OSS
uses: manyuanrong/setup-ossutil@v2.0
with:
endpoint: "oss-cn-beijing.aliyuncs.com"
access-key-id: ${{ secrets.ALIYUN_ACCESSKEY_ID }}
access-key-secret: ${{ secrets.ALIYUN_ACCESSKEY_SECRET }}
- name: Upload artifacts to aliyun OSS
run: |
ossutil cp -rf scripts/install.sh oss://httprunner/
ossutil cp -rf ${{ env.ASSET_PATH }} oss://httprunner/
- name: Test install.sh
run: bash -c "$(curl -ksSL https://httprunner.oss-cn-beijing.aliyuncs.com/install.sh)"

73
.github/workflows/hrp-scaffold.yml vendored Normal file
View File

@@ -0,0 +1,73 @@
name: Run scaffold for hrp
on:
push:
pull_request:
types: [synchronize]
jobs:
scaffold-with-python-plugin:
strategy:
fail-fast: false
matrix:
go-version:
- 1.17.x
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Build hrp binary
run: make build
- name: Run start project
run: ./output/hrp startproject demo
- name: Run demo tests
run: ./output/hrp run demo/testcases/demo.json demo/testcases/demo.yaml
scaffold-with-go-plugin:
strategy:
fail-fast: false
matrix:
go-version:
- 1.17.x
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Build hrp binary
run: make build
- name: Run start project
run: ./output/hrp startproject demo --go
- name: Run demo tests
run: ./output/hrp run demo/testcases/demo.json demo/testcases/demo.yaml
scaffold-without-custom-plugin:
strategy:
fail-fast: false
matrix:
go-version:
- 1.17.x
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Build hrp binary
run: make build
- name: Run start project
run: ./output/hrp startproject demo --ignore-plugin
- name: Run demo tests
run: ./output/hrp run demo/testcases/demo.json demo/testcases/demo.yaml

View File

@@ -1,4 +1,4 @@
name: integration_test
name: run smoke tests for httprunner
on:
push:
@@ -6,9 +6,9 @@ on:
types: [synchronize]
jobs:
integration_test:
smoke-test:
name: integration_test - ${{ matrix.python-version }} on ${{ matrix.os }}
name: smoketest - ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false

View File

@@ -1,4 +1,4 @@
name: unittest
name: Run unittests
on:
push:
@@ -6,9 +6,7 @@ on:
types: [synchronize]
jobs:
unittest:
name: unittest - ${{ matrix.python-version }} on ${{ matrix.os }}
py-httprunner:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
@@ -54,3 +52,34 @@ jobs:
flags: unittests
# Specify whether or not CI build should fail if Codecov runs into an error during upload
fail_ci_if_error: true
go-hrp:
strategy:
fail-fast: false
matrix:
go-version:
- 1.16.x
- 1.17.x
- 1.18.x
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Install Python plugin dependencies
run: python3 -m pip install funppy
- name: Checkout code
uses: actions/checkout@v2
- name: Run coverage
run: go test -coverprofile="cover.out" -covermode=atomic -race ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
name: hrp (HttpRunner+) # User defined upload name. Visible in Codecov UI
token: ${{ secrets.CODECOV_TOKEN }} # Repository upload token
file: ./cover.out # Path to coverage file to upload
flags: unittests # Flag upload to group coverage metrics
fail_ci_if_error: true # Specify whether or not CI build should fail if Codecov runs into an error during upload
verbose: true