mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-09-19 09:40:12 +00:00
Merge branch 'upstream/master' into master and preserve domain extensions
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
open-pull-requests-limit: 10
|
||||
groups:
|
||||
go-dependencies:
|
||||
patterns:
|
||||
- "*"
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
open-pull-requests-limit: 5
|
||||
groups:
|
||||
github-actions:
|
||||
patterns:
|
||||
- "*"
|
||||
@@ -36,7 +36,7 @@ jobs:
|
||||
|
||||
- run: git config --global --add safe.directory /__w/nezha/nezha
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v7.0.1
|
||||
|
||||
- name: Prepare frontends' dists
|
||||
run: |
|
||||
@@ -50,7 +50,7 @@ jobs:
|
||||
wget -qO pkg/geoip/geoip.db https://ipinfo.io/data/free/country.mmdb?token=${IPINFO_TOKEN}
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version: "1.26.x"
|
||||
|
||||
@@ -63,7 +63,7 @@ jobs:
|
||||
- name: Cache zstd for s390x
|
||||
if: matrix.goarch == 's390x'
|
||||
id: cache-zstd
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: /tmp/zstd-s390x
|
||||
key: zstd-s390x-v1.5.7
|
||||
@@ -99,7 +99,7 @@ jobs:
|
||||
|
||||
- name: Build with tag
|
||||
if: contains(github.ref, 'refs/tags/')
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
uses: goreleaser/goreleaser-action@v7
|
||||
env:
|
||||
GOOS: ${{ matrix.goos }}
|
||||
GOARCH: ${{ matrix.goarch }}
|
||||
@@ -111,7 +111,7 @@ jobs:
|
||||
|
||||
- name: Build snapshot
|
||||
if: contains(github.ref, 'refs/tags/') == false
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
uses: goreleaser/goreleaser-action@v7
|
||||
env:
|
||||
GOOS: ${{ matrix.goos }}
|
||||
GOARCH: ${{ matrix.goarch }}
|
||||
@@ -122,7 +122,7 @@ jobs:
|
||||
args: build --single-target --clean --skip=validate --snapshot
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: dashboard-${{ matrix.goos }}-${{ matrix.goarch }}
|
||||
path: |
|
||||
@@ -135,7 +135,7 @@ jobs:
|
||||
name: Release
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
path: ./assets
|
||||
|
||||
@@ -149,7 +149,7 @@ jobs:
|
||||
done
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
uses: softprops/action-gh-release@v3
|
||||
with:
|
||||
files: "assets/*/*/*.zip"
|
||||
generate_release_notes: true
|
||||
@@ -181,10 +181,10 @@ jobs:
|
||||
needs: build
|
||||
name: Release Docker images
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v7.0.1
|
||||
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
path: ./assets
|
||||
|
||||
@@ -220,10 +220,10 @@ jobs:
|
||||
password: ${{ secrets.ALI_PAT }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v4
|
||||
|
||||
- name: Set up image name
|
||||
run: |
|
||||
@@ -238,11 +238,16 @@ jobs:
|
||||
|
||||
- name: Build dasbboard image And Push with tag
|
||||
if: contains(github.ref, 'refs/tags/')
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm64,linux/s390x
|
||||
# Aliyun Container Registry rejects BuildKit attestation manifests
|
||||
# (application/vnd.oci.empty.v1+json). Both registries share this
|
||||
# multi-platform push, so publish a plain OCI image index here.
|
||||
provenance: false
|
||||
sbom: false
|
||||
push: true
|
||||
tags: |
|
||||
${{ steps.image-name.outputs.GHCR_IMAGE_NAME }}:latest
|
||||
@@ -252,7 +257,7 @@ jobs:
|
||||
|
||||
- name: Build dasbboard image And Push snapshot
|
||||
if: contains(github.ref, 'refs/tags/') == false
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
|
||||
+117
-26
@@ -2,54 +2,145 @@ name: Run Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "**.go"
|
||||
- "go.mod"
|
||||
- "go.sum"
|
||||
- "resource/**"
|
||||
- ".github/workflows/test.yml"
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
merge_group:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: nezha-quality-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: Ordinary tests and build (${{ matrix.os }})
|
||||
strategy:
|
||||
fail-fast: true
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu, windows, macos]
|
||||
|
||||
runs-on: ${{ matrix.os }}-latest
|
||||
env:
|
||||
GO111MODULE: on
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version: "1.26.x"
|
||||
cache: false
|
||||
|
||||
- name: generate swagger docs
|
||||
shell: bash
|
||||
- name: Generate Swagger docs
|
||||
run: |
|
||||
go install github.com/swaggo/swag/cmd/swag@latest
|
||||
mkdir -p ./cmd/dashboard/user-dist ./cmd/dashboard/admin-dist
|
||||
go install github.com/swaggo/swag/cmd/swag@v1.16.6
|
||||
touch ./cmd/dashboard/user-dist/a
|
||||
touch ./cmd/dashboard/admin-dist/a
|
||||
swag init --pd -d cmd/dashboard -g main.go -o cmd/dashboard/docs
|
||||
|
||||
- name: Unit test
|
||||
run: |
|
||||
go test -v ./...
|
||||
run: go test -mod=readonly -count=1 ./...
|
||||
|
||||
- name: Build test
|
||||
- name: Build dashboard
|
||||
run: go build -v ./cmd/dashboard
|
||||
|
||||
linux-race-quality:
|
||||
name: Linux race and quality
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version: "1.26.x"
|
||||
cache: false
|
||||
|
||||
- name: Generate Swagger docs
|
||||
run: |
|
||||
go install github.com/swaggo/swag/cmd/swag@v1.16.6
|
||||
touch ./cmd/dashboard/user-dist/a
|
||||
touch ./cmd/dashboard/admin-dist/a
|
||||
swag init --pd -d cmd/dashboard -g main.go -o cmd/dashboard/docs
|
||||
|
||||
- name: Race and shuffle tests
|
||||
run: go test -mod=readonly -race -shuffle=on -count=1 ./...
|
||||
|
||||
- name: Vet
|
||||
run: go vet ./...
|
||||
|
||||
- name: Check formatting
|
||||
shell: bash
|
||||
run: test -z "$(git ls-files -co --exclude-standard '*.go' -z | xargs -0 gofmt -l)"
|
||||
|
||||
- name: Build dashboard
|
||||
run: go build ./cmd/dashboard
|
||||
|
||||
- name: Run Gosec Security Scanner
|
||||
if: runner.os == 'Linux'
|
||||
uses: securego/gosec@master
|
||||
shell: bash
|
||||
env:
|
||||
GOTOOLCHAIN: auto
|
||||
run: |
|
||||
go install github.com/securego/gosec/v2/cmd/gosec@v2.27.1
|
||||
gosec --exclude=G104,G115,G117,G203,G402,G703,G704 ./...
|
||||
|
||||
agentcompat-stress:
|
||||
name: Linux agent compatibility stress
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 75
|
||||
steps:
|
||||
- name: Checkout Nezha revision
|
||||
uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
args: --exclude=G103,G104,G107,G115,G117,G203,G402,G703,G704 ./...
|
||||
path: nezha
|
||||
persist-credentials: false
|
||||
- name: Checkout Agent repository
|
||||
uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
repository: nezhahq/agent
|
||||
path: agent
|
||||
persist-credentials: false
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version: "1.26.x"
|
||||
cache: false
|
||||
- name: Prepare Dashboard build inputs
|
||||
working-directory: nezha
|
||||
run: |
|
||||
go install github.com/swaggo/swag/cmd/swag@v1.16.6
|
||||
mkdir -p cmd/dashboard/user-dist cmd/dashboard/admin-dist
|
||||
printf 'placeholder\n' > cmd/dashboard/user-dist/placeholder.txt
|
||||
printf 'placeholder\n' > cmd/dashboard/admin-dist/placeholder.txt
|
||||
swag init --pd -d cmd/dashboard -g main.go -o cmd/dashboard/docs
|
||||
- name: Require named stress test
|
||||
working-directory: nezha
|
||||
run: go test -mod=readonly -tags=agentcompat -list '^TestStressPRFullEightAgentExactlyOnce$' ./integration/agentcompat/internal/scenario | grep -Fx 'TestStressPRFullEightAgentExactlyOnce'
|
||||
- name: Run PR-full agent compatibility stress
|
||||
working-directory: nezha
|
||||
env:
|
||||
AGENTCOMPAT_NEZHA_SOURCE: ${{ github.workspace }}/nezha
|
||||
AGENTCOMPAT_AGENT_SOURCE: ${{ github.workspace }}/agent
|
||||
run: go test -mod=readonly -tags=agentcompat -run '^TestStressPRFullEightAgentExactlyOnce$' -count=1 -v ./integration/agentcompat/internal/scenario
|
||||
|
||||
nezha-quality-required:
|
||||
name: nezha-quality-required
|
||||
if: ${{ always() }}
|
||||
needs:
|
||||
- tests
|
||||
- linux-race-quality
|
||||
- agentcompat-stress
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Require all blocking jobs to pass
|
||||
shell: bash
|
||||
run: |
|
||||
test "${{ needs.tests.result }}" = success
|
||||
test "${{ needs.linux-race-quality.result }}" = success
|
||||
test "${{ needs.agentcompat-stress.result }}" = success
|
||||
|
||||
|
||||
Reference in New Issue
Block a user