From aab3d2c2dbf7271b2ea9da2d512a47a7354ed2a5 Mon Sep 17 00:00:00 2001 From: n0099 Date: Mon, 12 Feb 2024 09:29:01 +0800 Subject: [PATCH] + workflows/{fe,c#}.yml + codechecks.yml @ .github --- .github/actions/c#/action.yml | 19 +++++++++++++++++++ .github/actions/fe/action.yml | 15 +++++++++++++++ .github/codechecks.yml | 8 ++++++++ .github/workflows/c#.yml | 18 ++++++++++++++++++ .github/workflows/fe.yml | 30 ++++++++++++++++++++++++++++++ 5 files changed, 90 insertions(+) create mode 100644 .github/actions/c#/action.yml create mode 100644 .github/actions/fe/action.yml create mode 100644 .github/codechecks.yml create mode 100644 .github/workflows/c#.yml create mode 100644 .github/workflows/fe.yml diff --git a/.github/actions/c#/action.yml b/.github/actions/c#/action.yml new file mode 100644 index 00000000..51621404 --- /dev/null +++ b/.github/actions/c#/action.yml @@ -0,0 +1,19 @@ +name: c#/init +description: c#/init +runs: + using: composite + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: 7 + cache: true + cache-dependency-path: ${{ github.workspace }}/c#/*/packages.lock.json + - run: dotnet new globaljson --sdk-version 7.0.405 + working-directory: c# + shell: bash + - run: dotnet restore + working-directory: c# + shell: bash diff --git a/.github/actions/fe/action.yml b/.github/actions/fe/action.yml new file mode 100644 index 00000000..bdeb6260 --- /dev/null +++ b/.github/actions/fe/action.yml @@ -0,0 +1,15 @@ +name: fe/init +description: fe/init +runs: + using: composite + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: yarn + cache-dependency-path: ${{ github.workspace }}/fe/yarn.lock + - name: install + run: yarn install --immutable + working-directory: fe + shell: bash diff --git a/.github/codechecks.yml b/.github/codechecks.yml new file mode 100644 index 00000000..5f7b4eed --- /dev/null +++ b/.github/codechecks.yml @@ -0,0 +1,8 @@ +settings: + # https://github.com/codechecks/monorepo/blob/4ccc8bbaab1586c0ef265f234f0a275fd40b38f8/packages/client/src/speculativeBranchSelection.ts#L73 + branches: ['v2'] +checks: + - name: typecov + options: + strict: true + atLeast: 95 diff --git a/.github/workflows/c#.yml b/.github/workflows/c#.yml new file mode 100644 index 00000000..f7d078c4 --- /dev/null +++ b/.github/workflows/c#.yml @@ -0,0 +1,18 @@ +name: c# +on: + push: + #paths: [c#/**] +defaults: + run: + working-directory: c# +jobs: + init: + runs-on: ubuntu-latest + strategy: + matrix: + project: [crawler, imagePipeline, shared, tbClient] + steps: + - uses: actions/checkout@v4 + - uses: .github/actions/c#/action.yml + - name: build + run: dotnet build -c Debug ${{ matrix.project }} diff --git a/.github/workflows/fe.yml b/.github/workflows/fe.yml new file mode 100644 index 00000000..61d0381b --- /dev/null +++ b/.github/workflows/fe.yml @@ -0,0 +1,30 @@ +name: fe +on: + push: + #paths: [fe/**] +defaults: + run: + working-directory: fe +jobs: + tsc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: .github/actions/fe/action.yml + - run: yarn run vue-tsc + eslint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: .github/actions/fe/action.yml + - run: yarn run eslint src + codechecks: + runs-on: ubuntu-latest + steps: # contains CVE that triggers Dependabot + - uses: actions/checkout@v4 + - uses: .github/actions/fe/action.yml + - run: | + yarn add -D typecov @codechecks/client + yarn run codechecks ../.github/codechecks.yml + env: + CC_SECRET: ${{ secrets.CC_SECRET }}