Skip to content

Commit

Permalink
Enable lint and unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Apolinario <[email protected]>
  • Loading branch information
eapolinario committed Sep 13, 2023
1 parent 67ba70b commit 272321a
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 13 deletions.
55 changes: 42 additions & 13 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,48 @@ jobs:
run: |
echo "go-version=${{ env.GO_VERSION }}" >> $GITHUB_OUTPUT
# lint:
# name: Lint
# uses: flyteorg/flytetools/.github/workflows/lint.yml@master
# with:
# go-version: "1.19"

# tests:
# name: Unit Tests
# uses: flyteorg/flytetools/.github/workflows/tests.yml@master
# with:
# go-version: "1.19"
# secrets:
# FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }}
lint:
name: Lint
needs:
- unpack-envvars
strategy:
fail-fast: false
matrix:
component:
- datacatalog
- flyteadmin
# TODO(monorepo): Enable lint flytecopilot
# - flytecopilot
- flytecopilot
- flyteidl
- flyteplugins
- flytepropeller
- flytestdlib
uses: ./.github/workflows/lint.yml
with:
go-version: ${{ needs.unpack-envvars.outputs.go-version }}
unit-tests:
name: Unit Tests
needs:
- unpack-envvars
strategy:
fail-fast: false
matrix:
component:
- datacatalog
- flyteadmin
- flytecopilot
# TODO(monorepo): Enable flyteidl unit tests
# flyteidl
- flyteidl
- flyteplugins
- flytepropeller
- flytestdlib
uses: ./.github/workflows/unit-tests.yml
with:
go-version: ${{ needs.unpack-envvars.outputs.go-version }}
secrets:
FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }}
docker-build:
strategy:
fail-fast: false
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Lint

on:
workflow_call:
inputs:
component:
required: true
type: string
go-version:
required: true
type: string
jobs:
lint:
name: Run Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.component }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ inputs.go-version }}
- name: Lint
run: make install && make lint
41 changes: 41 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Unit Tests

on:
workflow_call:
inputs:
component:
required: true
type: string
go-version:
required: true
type: string
secrets:
FLYTE_BOT_PAT:
required: true
jobs:
tests:
name: Run Unit Test
defaults:
run:
working-directory: ${{ inputs.component }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ inputs.go-version }}
- name: Unit Tests
env:
GITHUB_TOKEN: ${{ secrets.FLYTE_BOT_PAT }}
run: make install && make test_unit_codecov
# TODO(monorepo): Figure out how to do code coverage aggregation
- name: Push CodeCov
uses: codecov/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.FLYTE_BOT_PAT }}
with:
file: coverage.txt
flags: unittests
fail_ci_if_error: false

0 comments on commit 272321a

Please sign in to comment.