CI: fix path (#2557)

* ci: also upload coverage for pr

* ci: bump codecov action

* ci: add path filter

* ci: fix add checkout

* ci: fix 'true'

* ci: remove /

* ci: add flag to codecov

* ci: add carryforward on integration
This commit is contained in:
Jonathan Ho
2022-10-27 09:29:49 -05:00
committed by GitHub
parent 999fdb2c45
commit 9d9ba4c251
2 changed files with 51 additions and 6 deletions
+42 -6
View File
@@ -15,9 +15,41 @@ jobs:
deno-version: v1.x
- name: Check Formatting
run: deno fmt --check
# change if any prod code changed, skip test without chnage
path-filter:
name: Check Path Changes
runs-on: ubuntu-latest
outputs:
code-change: ${{ steps.changes.outputs.code-change }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
code-change:
- ".github/workflows/test.yml"
- "gateway/**"
- "handlers/**"
- "helpers/**"
- "packages/**"
- "plugins/**"
- "rest/**"
- "template/**"
- "tests/**"
- "transformers/**"
- "types/**"
- "util/**"
- "bot.ts"
- "mod.ts"
- "dnt.ts"
type-test:
name: Type Test
runs-on: ubuntu-latest
needs: path-filter
if: ${{ needs.path-filter.outputs.code-change == 'true' }}
steps:
- uses: actions/checkout@v3
- uses: denoland/setup-deno@main
@@ -29,9 +61,12 @@ jobs:
run: deno check plugins/mod.ts
- name: Check Templates
run: deno check template/beginner/mod.ts template/minimal/mod.ts
integration-test:
name: Integration Test
runs-on: ubuntu-latest
needs: path-filter
if: ${{ needs.path-filter.outputs.code-change == 'true' }}
concurrency: integration-test
steps:
- uses: actions/checkout@v3
@@ -48,16 +83,18 @@ jobs:
PROXY_REST_SECRET: ${{ secrets.PROXY_REST_SECRET }}
PROXY_REST_URL: ${{ secrets.PROXY_REST_URL }}
- name: Create coverage report
if: github.ref == 'refs/heads/main'
run: deno coverage --exclude=tests ./coverage --lcov > coverage.lcov
- name: Collect and upload the coverage report
if: github.ref == 'refs/heads/main'
uses: codecov/codecov-action@v1.0.10
uses: codecov/codecov-action@v3
with:
file: ./coverage.lcov
flags: integration
unit-test:
name: Unit Test
runs-on: ubuntu-latest
needs: path-filter
if: ${{ needs.path-filter.outputs.code-change == 'true' }}
steps:
- uses: actions/checkout@v3
- uses: denoland/setup-deno@main
@@ -68,10 +105,9 @@ jobs:
env:
TEST_ENV: UNIT
- name: Create coverage report
if: github.ref == 'refs/heads/main'
run: deno coverage --exclude=tests ./coverage --lcov > coverage.lcov
- name: Collect and upload the coverage report
if: github.ref == 'refs/heads/main'
uses: codecov/codecov-action@v1.0.10
uses: codecov/codecov-action@v3
with:
file: ./coverage.lcov
flags: unit