-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Juan Hernandez <[email protected]>
- Loading branch information
Showing
21 changed files
with
790 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,9 @@ | |
!/LICENSE.txt | ||
!/Makefile | ||
!/README.md | ||
!/dev.py | ||
!/dev.txt | ||
!/dev/ | ||
!/go.mod | ||
!/go.sum | ||
!/internal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# | ||
# Copyright (c) 2023 Red Hat, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
# in compliance with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software distributed under the License | ||
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
# or implied. See the License for the specific language governing permissions and limitations under | ||
# the License. | ||
# | ||
|
||
name: Install tools | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.11' | ||
cache: pip | ||
cache-dependency-path: dev.txt | ||
|
||
- name: Install Python modules | ||
shell: bash | ||
run: pip install -r dev.txt | ||
|
||
- name: Install tools | ||
shell: bash | ||
run: ./dev.py setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,8 +28,11 @@ jobs: | |
- name: Checkout the source | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install tools | ||
uses: ./.github/actions/install-tools | ||
|
||
- name: Build image | ||
run: make image | ||
run: ./dev.py build image | ||
|
||
unit-tests: | ||
name: Unit tests | ||
|
@@ -38,18 +41,14 @@ jobs: | |
- name: Checkout the source | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
- name: Install tools | ||
uses: ./.github/actions/install-tools | ||
|
||
- name: Install Go tools | ||
run: | | ||
go install github.com/onsi/ginkgo/v2/ginkgo@$(go list -f '{{.Version}}' -m github.com/onsi/ginkgo/v2) | ||
go install go.uber.org/mock/[email protected] | ||
- name: Install tools | ||
run: ./dev.py setup | ||
|
||
- name: Run the tests | ||
run: make tests | ||
run: ./dev.py test | ||
|
||
check-generated-code: | ||
name: Check generated code | ||
|
@@ -58,17 +57,11 @@ jobs: | |
- name: Checkout the source | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
|
||
- name: Install Go tools | ||
run: | | ||
go install go.uber.org/mock/[email protected] | ||
- name: Install tools | ||
uses: ./.github/actions/install-tools | ||
|
||
- name: Generate code | ||
run: make generate | ||
run: ./dev.py generate | ||
|
||
- name: Check differences | ||
run: git diff --exit-code | ||
|
@@ -80,13 +73,8 @@ jobs: | |
- name: Checkout the source | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
- name: Install tools | ||
uses: ./.github/actions/install-tools | ||
|
||
- name: Run the linter | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.54.2 | ||
args: --timeout=5m | ||
run: ./dev.py lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
*.log | ||
*.pyc | ||
/__debug* | ||
/oran-o2ims | ||
__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
# | ||
# Copyright (c) 2023 Red Hat Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
# in compliance with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software distributed under the License | ||
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
# or implied. See the License for the specific language governing permissions and limitations under | ||
# the License. | ||
# | ||
|
||
""" | ||
This script is a development tool for the project. | ||
""" | ||
|
||
import logging | ||
import sys | ||
|
||
import click | ||
|
||
import dev | ||
|
||
@click.group() | ||
def cli(): | ||
""" | ||
Development tools. | ||
""" | ||
|
||
# Add the commands: | ||
cli.add_command(dev.build) | ||
cli.add_command(dev.ci_job) | ||
cli.add_command(dev.clean) | ||
cli.add_command(dev.fmt) | ||
cli.add_command(dev.generate) | ||
cli.add_command(dev.lint) | ||
cli.add_command(dev.push) | ||
cli.add_command(dev.setup) | ||
cli.add_command(dev.test) | ||
|
||
if __name__ == '__main__': | ||
# Configure logging: | ||
formatter = dev.Formatter() | ||
handler = logging.StreamHandler() | ||
handler.setFormatter(formatter) | ||
logging.root.handlers = [handler] | ||
logging.root.level = logging.DEBUG | ||
|
||
# Run the command: | ||
try: | ||
cli() | ||
except Exception as err: | ||
logging.error(err) | ||
sys.exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# | ||
# Copyright (c) 2023 Red Hat Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
# in compliance with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software distributed under the License | ||
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
# or implied. See the License for the specific language governing permissions and limitations under | ||
# the License. | ||
# | ||
|
||
from .build import * | ||
from .ci_job import * | ||
from .clean import * | ||
from .fmt import * | ||
from .formatter import * | ||
from .generate import * | ||
from .lint import * | ||
from .push import * | ||
from .setup import * | ||
from .test import * |
Oops, something went wrong.