官网挂了,dingding群失效 #3112
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sealer-Test-Run | |
on: | |
push: | |
branches: "release*" | |
issue_comment: | |
types: | |
- created | |
workflow_dispatch: { } | |
pull_request_target: | |
types: [ opened, synchronize, reopened ] | |
branches: "*" | |
paths-ignore: | |
- 'docs/**' | |
- '*.md' | |
- '*.yml' | |
- '.github' | |
permissions: | |
statuses: write | |
jobs: | |
build: | |
name: test | |
runs-on: ubuntu-latest | |
if: ${{ (github.event.issue.pull_request && (github.event.comment.body == '/test all' || github.event.comment.body == '/test run')) || github.event_name == 'push' || github.event_name == 'pull_request_target' }} | |
env: | |
GO111MODULE: on | |
steps: | |
- name: Get PR details | |
if: ${{ github.event_name == 'issue_comment'}} | |
uses: xt0rted/pull-request-comment-branch@v1 | |
id: comment-branch | |
- name: Set commit status as pending | |
if: ${{ github.event_name == 'issue_comment'}} | |
uses: myrotvorets/set-commit-status-action@master | |
with: | |
sha: ${{ steps.comment-branch.outputs.head_sha }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
status: pending | |
- name: Github API Request | |
id: request | |
uses: octokit/[email protected] | |
with: | |
route: ${{ github.event.issue.pull_request.url }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get PR informations | |
id: pr_data | |
run: | | |
echo "repo_name=${{ fromJson(steps.request.outputs.data).head.repo.full_name }}" >> $GITHUB_STATE | |
echo "repo_clone_url=${{ fromJson(steps.request.outputs.data).head.repo.clone_url }}" >> $GITHUB_STATE | |
echo "repo_ssh_url=${{ fromJson(steps.request.outputs.data).head.repo.ssh_url }}" >> $GITHUB_STATE | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
ref: ${{ github.event.pull_request.head.sha }} | |
path: src/github.com/sealerio/sealer | |
- name: Install deps | |
run: | | |
sudo su | |
sudo apt-get update | |
sudo apt-get install -y libgpgme-dev libbtrfs-dev libdevmapper-dev | |
sudo mkdir /var/lib/sealer | |
- name: Set up Go 1.17 | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.17 | |
id: go | |
- name: Install sealer and ginkgo | |
shell: bash | |
run: | | |
docker run --rm -v ${PWD}:/usr/src/sealer -w /usr/src/sealer registry.cn-qingdao.aliyuncs.com/sealer-io/sealer-build:v1 make linux | |
export SEALER_DIR=${PWD}/_output/bin/sealer/linux_amd64 | |
echo "$SEALER_DIR" >> $GITHUB_PATH | |
go install github.com/onsi/ginkgo/[email protected] | |
go install github.com/onsi/gomega/[email protected] | |
GOPATH=`go env GOPATH` | |
echo "$GOPATH/bin" >> $GITHUB_PATH | |
working-directory: src/github.com/sealerio/sealer | |
- name: Run sealer run test and generate coverage | |
shell: bash | |
working-directory: src/github.com/sealerio/sealer | |
env: | |
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} | |
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} | |
REGISTRY_URL: ${{ secrets.REGISTRY_URL }} | |
IMAGE_NAME: ${{ secrets.IMAGE_NAME}} | |
ACCESSKEYID: ${{ secrets.ACCESSKEYID }} | |
ACCESSKEYSECRET: ${{ secrets.ACCESSKEYSECRET }} | |
RegionID: ${{ secrets.RegionID }} | |
if: ${{ github.event.comment.body == '/test run' || github.event.comment.body == '/test all' || github.event_name == 'push' || github.event_name == 'pull_request_target' }} | |
run: | | |
# fix bug in kernal 5.12.2+:open /proc/sys/net/netfilter/nf_conntrack_max: permission denied, see: https://github.com/kubernetes-sigs/kind/issues/2240 | |
sudo sysctl net/netfilter/nf_conntrack_max=131072 | |
ginkgo -v -focus="sealer run" -cover -covermode=atomic -coverpkg=./... -coverprofile=/tmp/coverage.out -trace test | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: /tmp/coverage.out | |
flags: e2e-tests | |
name: codecov-umbrella | |
- name: Set final commit status | |
uses: myrotvorets/set-commit-status-action@master | |
if: contains(github.event.comment.body, '/test') && always() | |
with: | |
sha: ${{ steps.comment-branch.outputs.head_sha }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
status: ${{ job.status }} |