ci: comment out costly things (#4)

This commit is contained in:
UUBulb 2024-11-10 07:09:38 +08:00 committed by GitHub
parent e15dddae73
commit 3168055948
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 27 additions and 26 deletions

View File

@ -17,8 +17,8 @@ on:
pull_request: pull_request:
# The branches below must be a subset of the branches above # The branches below must be a subset of the branches above
branches: [ master ] branches: [ master ]
schedule: #schedule:
- cron: '15 20 * * 0' # - cron: '15 20 * * 0'
jobs: jobs:
analyze: analyze:

View File

@ -12,20 +12,23 @@ jobs:
strategy: strategy:
fail-fast: true fail-fast: true
matrix: matrix:
goos: [linux, windows] goos: [
linux,
#windows
]
goarch: [amd64] goarch: [amd64]
include: #include:
- goos: linux # - goos: linux
goarch: s390x # goarch: s390x
- goos: linux # - goos: linux
goarch: arm64 # goarch: arm64
name: Build artifacts name: Build artifacts
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: #container:
image: goreleaser/goreleaser-cross:v1.23 # image: goreleaser/goreleaser-cross:v1.23
steps: steps:
- run: git config --global --add safe.directory /__w/nezha/nezha # - run: git config --global --add safe.directory /__w/nezha/nezha
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Fetch IPInfo GeoIP Database - name: Fetch IPInfo GeoIP Database
@ -44,17 +47,16 @@ jobs:
run: | run: |
go install github.com/swaggo/swag/cmd/swag@latest go install github.com/swaggo/swag/cmd/swag@latest
swag init --pd -d . -g ./cmd/dashboard/main.go -o ./cmd/dashboard/docs --parseGoList=false swag init --pd -d . -g ./cmd/dashboard/main.go -o ./cmd/dashboard/docs --parseGoList=false
- name: Build with tag - name: Build with tag
if: contains(github.ref, 'refs/tags/') if: contains(github.ref, 'refs/tags/')
uses: goreleaser/goreleaser-action@v6 uses: goreleaser/goreleaser-action@v6
env: env:
GOOS: ${{ matrix.goos }} GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }} GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
with: with:
distribution: goreleaser distribution: goreleaser
version: '~> v2' version: "~> v2"
args: build --single-target --clean --skip=validate args: build --single-target --clean --skip=validate
- name: Build snapshot - name: Build snapshot
@ -63,10 +65,9 @@ jobs:
env: env:
GOOS: ${{ matrix.goos }} GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }} GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
with: with:
distribution: goreleaser distribution: goreleaser
version: '~> v2' version: "~> v2"
args: build --single-target --clean --skip=validate --snapshot args: build --single-target --clean --skip=validate --snapshot
- name: Upload artifacts - name: Upload artifacts
@ -138,7 +139,7 @@ jobs:
# mv dist admin-dist # mv dist admin-dist
mkdir admin-dist mkdir admin-dist
mkdir user-dist mkdir user-dist
- name: Download artifacts - name: Download artifacts
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
@ -212,7 +213,7 @@ jobs:
with: with:
context: . context: .
file: ./Dockerfile file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/s390x platforms: linux/amd64
push: true push: true
tags: | tags: |
${{ steps.image-name.outputs.GHCR_IMAGE_NAME }}:${{ steps.extract_branch.outputs.tag }} ${{ steps.image-name.outputs.GHCR_IMAGE_NAME }}:${{ steps.extract_branch.outputs.tag }}

View File

@ -1,13 +1,13 @@
name: Run Tests name: Run Tests
on: on:
push: #push:
paths: # paths:
- "**.go" # - "**.go"
- "go.mod" # - "go.mod"
- "go.sum" # - "go.sum"
- "resource/**" # - "resource/**"
- ".github/workflows/test.yml" # - ".github/workflows/test.yml"
pull_request: pull_request:
branches: branches:
- master - master