-
Notifications
You must be signed in to change notification settings - Fork 1
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: Gaius <[email protected]>
- Loading branch information
Showing
15 changed files
with
676 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
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,28 @@ | ||
name: Check Size | ||
|
||
on: | ||
push: | ||
branches: [main, release-*] | ||
pull_request: | ||
branches: [main, release-*] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
check_size: | ||
name: Check Size | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Check large files | ||
uses: actionsdesk/lfs-warning@e5f9a4c21f4bee104db7c0f23954dde59e5df909 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
filesizelimit: "1048576" |
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,34 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main, release-*] | ||
paths-ignore: ['**.md', '**.png', '**.jpg', '**.svg', '**/docs/**'] | ||
pull_request: | ||
branches: [main, release-*] | ||
paths-ignore: ['**.md', '**.png', '**.jpg', '**.svg', '**/docs/**'] | ||
schedule: | ||
- cron: '0 4 * * *' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 | ||
with: | ||
go-version-file: go.mod | ||
|
||
- name: Run Unit tests | ||
run: |- | ||
echo running unit tests |
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,42 @@ | ||
name: CodeQL Analysis | ||
|
||
on: | ||
push: | ||
branches: [main, release-*] | ||
paths-ignore: ['**.md', '**.png', '**.jpg', '**.svg', '**/docs/**'] | ||
pull_request: | ||
branches: [main, release-*] | ||
paths-ignore: ['**.md', '**.png', '**.jpg', '**.svg', '**/docs/**'] | ||
schedule: | ||
- cron: '0 4 * * *' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [go] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@c36620d31ac7c881962c3d9dd939c40ec9434f2b | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@c36620d31ac7c881962c3d9dd939c40ec9434f2b | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@c36620d31ac7c881962c3d9dd939c40ec9434f2b |
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,30 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: [main, release-*] | ||
pull_request: | ||
branches: [main, release-*] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 | ||
|
||
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 | ||
with: | ||
go-version-file: go.mod | ||
cache: false | ||
|
||
- name: Golangci lint | ||
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 | ||
with: | ||
version: v1.54 | ||
args: --verbose |
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,23 @@ | ||
/* | ||
* Copyright 2024 The CNAI Authors | ||
* | ||
* 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. | ||
*/ | ||
|
||
package main | ||
|
||
import "github.com/CloudNativeAI/modctl/cmd/modctl" | ||
|
||
func main() { | ||
modctl.Execute() | ||
} |
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,55 @@ | ||
/* | ||
* Copyright 2024 The CNAI Authors | ||
* | ||
* 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. | ||
*/ | ||
|
||
package modctl | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/sirupsen/logrus" | ||
"github.com/spf13/cobra" | ||
"github.com/spf13/viper" | ||
) | ||
|
||
// listCmd represents the modctl command for list. | ||
var listCmd = &cobra.Command{ | ||
Use: "list [flags]", | ||
Short: "A command line tool for modctl list", | ||
Args: cobra.NoArgs, | ||
DisableAutoGenTag: true, | ||
SilenceUsage: true, | ||
FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true}, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
logrus.Infof("running list") | ||
return runList(context.Background()) | ||
}, | ||
} | ||
|
||
// init initializes list command. | ||
func init() { | ||
flags := listCmd.Flags() | ||
|
||
if err := viper.BindPFlags(flags); err != nil { | ||
panic(fmt.Errorf("bind cache list flags to viper: %w", err)) | ||
} | ||
} | ||
|
||
// runList runs the list modctl. | ||
func runList(ctx context.Context) error { | ||
// TODO: Add list modctl logic here. | ||
return nil | ||
} |
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,55 @@ | ||
/* | ||
* Copyright 2024 The CNAI Authors | ||
* | ||
* 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. | ||
*/ | ||
|
||
package modctl | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/sirupsen/logrus" | ||
"github.com/spf13/cobra" | ||
"github.com/spf13/viper" | ||
) | ||
|
||
// loginCmd represents the modctl command for login. | ||
var loginCmd = &cobra.Command{ | ||
Use: "login [flags]", | ||
Short: "A command line tool for modctl login", | ||
Args: cobra.NoArgs, | ||
DisableAutoGenTag: true, | ||
SilenceUsage: true, | ||
FParseErrWhitelogin: cobra.FParseErrWhitelogin{UnknownFlags: true}, | ||
Check failure on line 35 in cmd/modctl/login.go GitHub Actions / Lint
|
||
RunE: func(cmd *cobra.Command, args []string) error { | ||
logrus.Infof("running login") | ||
return runLogin(context.Background()) | ||
}, | ||
} | ||
|
||
// init initializes login command. | ||
func init() { | ||
flags := loginCmd.Flags() | ||
|
||
if err := viper.BindPFlags(flags); err != nil { | ||
panic(fmt.Errorf("bind cache login flags to viper: %w", err)) | ||
} | ||
} | ||
|
||
// runLogin runs the login modctl. | ||
func runLogin(ctx context.Context) error { | ||
// TODO: Add login modctl logic here. | ||
return nil | ||
} |
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,55 @@ | ||
/* | ||
* Copyright 2024 The CNAI Authors | ||
* | ||
* 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. | ||
*/ | ||
|
||
package modctl | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/sirupsen/logrus" | ||
"github.com/spf13/cobra" | ||
"github.com/spf13/viper" | ||
) | ||
|
||
// logoutCmd represents the modctl command for logout. | ||
var logoutCmd = &cobra.Command{ | ||
Use: "logout [flags]", | ||
Short: "A command line tool for modctl logout", | ||
Args: cobra.NoArgs, | ||
DisableAutoGenTag: true, | ||
SilenceUsage: true, | ||
FParseErrWhitelogout: cobra.FParseErrWhitelogout{UnknownFlags: true}, | ||
Check failure on line 35 in cmd/modctl/logout.go GitHub Actions / Lint
|
||
RunE: func(cmd *cobra.Command, args []string) error { | ||
logrus.Infof("running logout") | ||
return runLogout(context.Background()) | ||
}, | ||
} | ||
|
||
// init initializes logout command. | ||
func init() { | ||
flags := logoutCmd.Flags() | ||
|
||
if err := viper.BindPFlags(flags); err != nil { | ||
panic(fmt.Errorf("bind cache logout flags to viper: %w", err)) | ||
} | ||
} | ||
|
||
// runLogout runs the logout modctl. | ||
func runLogout(ctx context.Context) error { | ||
// TODO: Add logout modctl logic here. | ||
return nil | ||
} |
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,55 @@ | ||
/* | ||
* Copyright 2024 The CNAI Authors | ||
* | ||
* 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. | ||
*/ | ||
|
||
package modctl | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/sirupsen/logrus" | ||
"github.com/spf13/cobra" | ||
"github.com/spf13/viper" | ||
) | ||
|
||
// pullCmd represents the modctl command for pull. | ||
var pullCmd = &cobra.Command{ | ||
Use: "pull [flags]", | ||
Short: "A command line tool for modctl pull", | ||
Args: cobra.NoArgs, | ||
DisableAutoGenTag: true, | ||
SilenceUsage: true, | ||
FParseErrWhitepull: cobra.FParseErrWhitepull{UnknownFlags: true}, | ||
Check failure on line 35 in cmd/modctl/pull.go GitHub Actions / Lint
|
||
RunE: func(cmd *cobra.Command, args []string) error { | ||
logrus.Infof("running pull") | ||
return runPull(context.Background()) | ||
}, | ||
} | ||
|
||
// init initializes pull command. | ||
func init() { | ||
flags := pullCmd.Flags() | ||
|
||
if err := viper.BindPFlags(flags); err != nil { | ||
panic(fmt.Errorf("bind cache pull flags to viper: %w", err)) | ||
} | ||
} | ||
|
||
// runPull runs the pull modctl. | ||
func runPull(ctx context.Context) error { | ||
// TODO: Add pull modctl logic here. | ||
return nil | ||
} |
Oops, something went wrong.