Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yk-eukarya committed Mar 8, 2024
1 parent 91a0ef8 commit 958aef4
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 80 deletions.
File renamed without changes.
File renamed without changes.
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: ci
on:
push:
branches: [main, release]
pull_request:
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
web: ${{ steps.web.outputs.any_changed }}
server: ${{ steps.server.outputs.any_changed }}
worker: ${{ steps.worker.outputs.any_changed }}
steps:
- name: checkout
uses: actions/checkout@v4
- name: changed files for web
id: web
uses: tj-actions/changed-files@v36
with:
files: |
web
.github/workflows/ci.yml
.github/workflows/ci_web.yml
- name: changed files for server
id: server
uses: tj-actions/changed-files@v36
with:
files: |
server
.github/workflows/ci.yml
.github/workflows/ci_server.yml
.github/workflows/build_server.yml
- name: changed files for worker
id: worker
uses: tj-actions/changed-files@v36
with:
files: |
worker
.github/workflows/ci.yml
.github/workflows/ci_worker.yml
.github/workflows/build_worker.yml
ci-web:
needs: prepare
if: needs.prepare.outputs.web == 'true'
uses: ./.github/workflows/ci_web.yml

ci-server:
needs: prepare
if: needs.prepare.outputs.server == 'true'
uses: ./.github/workflows/ci_server.yml

ci-worker:
needs: prepare
if: needs.prepare.outputs.worker == 'true'
uses: ./.github/workflows/ci_worker.yml

ci:
runs-on: ubuntu-latest
needs:
- ci-web
- ci-server
- ci-worker
if: '!failure()'
steps:
- run: echo OK
21 changes: 1 addition & 20 deletions .github/workflows/ci_server.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
name: ci-server
on:
push:
branches: [main, release]
paths:
- server/**
- .github/workflows/ci_server.yml
- .github/workflows/server_build.yml
- .github/workflows/deploy_test.yml
- .github/workflows/pr_title.yml
- .github/workflows/stage.yml
- .github/workflows/release.yml
- .github/workflows/server_build.yml
pull_request:
paths:
- server/**
- .github/workflows/ci_server.yml
- .github/workflows/server_build.yml
- .github/workflows/deploy_test.yml
- .github/workflows/pr_title.yml
- .github/workflows/stage.yml
- .github/workflows/release.yml
workflow_call:
env:
GO_VERSION: "1.22"

Expand Down
18 changes: 1 addition & 17 deletions .github/workflows/ci_web.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
name: ci-web
on:
push:
branches: [main, release]
paths:
- web/**
- .github/workflows/ci_web.yml
- .github/workflows/deploy_test.yml
- .github/workflows/pr_title.yml
- .github/workflows/stage.yml
- .github/workflows/release.yml
pull_request:
paths:
- web/**
- .github/workflows/ci_web.yml
- .github/workflows/deploy_test.yml
- .github/workflows/pr_title.yml
- .github/workflows/stage.yml
- .github/workflows/release.yml
workflow_call:
jobs:
ci:
name: ci
Expand Down
73 changes: 30 additions & 43 deletions .github/workflows/ci_worker.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,48 @@
name: ci-worker
on:
push:
branches: [main, release]
paths:
- worker/**
- .github/workflows/ci_worker.yml
- .github/workflows/deploy_test.yml
- .github/workflows/pr_title.yml
- .github/workflows/stage.yml
- .github/workflows/release.yml
- .github/workflows/decompressor_build.yml
- .github/workflows/worker_build.yml
pull_request:
paths:
- worker/**
- .github/workflows/ci_worker.yml
- .github/workflows/deploy_test.yml
- .github/workflows/pr_title.yml
- .github/workflows/stage.yml
- .github/workflows/release.yml
workflow_call:
env:
GO_VERSION: "1.22"
jobs:
ci:
name: ci
ci-server-lint:
name: lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: worker
services:
mongo:
image: mongo:6-focal
ports:
- 27017:27017
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.22
- name: checkout
uses: actions/checkout@v4
- name: cache
uses: actions/cache@v4
- name: go setup
uses: actions/setup-go@v5
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
go-version: ${{ env.GO_VERSION }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.54
version: v1.55
working-directory: worker
args: --config=../.golangci.yml
skip-cache: true
ci-server-test:
name: test
runs-on: ubuntu-latest
services:
mongo:
image: mongo:6-focal
ports:
- 27017:27017
steps:
- name: checkout
uses: actions/checkout@v4
- name: go setup
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: test
run: go test ./... -v -race -coverprofile=coverage.txt -covermode=atomic
run: go test ./... -v -race -coverprofile=coverage.txt -covermode=atomic -timeout 10m
working-directory: worker
env:
REEARTH_CMS_WORKER_DB: mongodb://localhost
- name: codecov
REEARTH_CMS_DB: mongodb://localhost
- name: Send coverage report
uses: codecov/codecov-action@v4
with:
flags: worker
file: coverage.txt
file: coverage.txt

0 comments on commit 958aef4

Please sign in to comment.