From 289d375826a2fb960fd24516edd7cee4755fc705 Mon Sep 17 00:00:00 2001 From: Matt Donoughe Date: Tue, 4 Apr 2023 09:54:47 -0400 Subject: [PATCH] Initial commit --- .github/CODEOWNERS | 3 + .github/ISSUE_TEMPLATE/bug_report.md | 23 ++++ .github/ISSUE_TEMPLATE/feature_request.md | 19 ++++ .github/PULL_REQUEST_TEMPLATE.md | 12 ++ .github/workflows/main.yml | 131 ++++++++++++++++++++++ .gitignore | 104 +++++++++++++++++ Cargo.toml | 8 ++ README.md | 8 ++ src/main.rs | 3 + 9 files changed, 311 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/main.yml create mode 100644 .gitignore create mode 100644 Cargo.toml create mode 100644 README.md create mode 100644 src/main.rs diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..dd606fb --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,3 @@ +#Specify Codeowners for this repo like so: +#* @phylum-dev/data-engineering @phylum-dev/core-platform +#/src/src/processors/ @phylum-dev/core-platform diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..ce2d792 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,23 @@ +--- +name: Bug Report +about: File a new bug report +title: '' +labels: bug, needs triage +assignees: '' + +--- + +# Overview +A clear and concise description of what the bug is. + +# How To Reproduce +Steps to reproduce this behavior: +1. Go to '...' +2. Click on '...' +3. See error + +# Expected Behavior +A clear and concise description of what you expected to happen. + +# Additional Context +Add any other context about the issue here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..6c476bd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,19 @@ +--- +name: New Feature/Component +about: Create a new feature/component request for a user story +title: '' +labels: enhancement, needs triage +assignees: '' + +--- + +# Overview +A concise description of the new feature component. + +# Acceptance Criteria +- [ ] Outputs XYZ when ... +- [ ] New endpoint ABC exists ... + +## Associated User Story +https://www.notion.so/phylum/... + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..658af40 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,12 @@ +# Overview +Provide information on what this PR does and any context necessary to understand its implementation. + +# Checklist +- [ ] Does this PR have an associated issue? +- [ ] Have you ensured that you have met the expected acceptance criteria? +- [ ] Have you created sufficient tests? + +Be sure to review additional expectations on the [developments standards page](https://www.notion.so/phylum/Development-Standards-and-Expectations-07f01c12f56b4bc099840d6074c92615#15d11ce9c55540cb90d604a4a178ee86). + +# Issue +What issue(s) does this PR close. Use the `closes #` here. diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..f9a5096 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,131 @@ +name: CI + +# Controls when the action will run. +on: + # Triggers the workflow on any pushes to any branch + push: + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + +# A baseline workflow that does `cargo fmt -- --check`, `cargo clippy --all-targets -- -D warnings`, and `cargo test` in parallel jobs +# Repos should append any additional CI/CD needs as neccessary +# Additional jobs like pushing up a docker image are provided but disabled by default via the "if" conditional and has other "# SET ME" things to set if enabled +jobs: + format-check: + runs-on: amd64 + steps: + - uses: actions/checkout@v2 + - name: Install minimal stable rustfmt + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + components: rustfmt + - name: Format Check + #run cargo fmt to fix if in violation + run: cargo fmt -- --check + build: + runs-on: amd64 + steps: + - uses: actions/checkout@v2 + - name: Install minimal stable with clippy + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + components: clippy + - name: Build + run: cargo build + - name: Clippy Linting + # --all-targets means apply to test code too. Without it just applies to application code + run: cargo clippy --all-targets -- -D warnings + test: + runs-on: amd64 + steps: + - uses: actions/checkout@v2 + - name: Install minimal stable + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + # - name: Start Docker Compose + # run: docker-compose up -d + # - name: Check containers after spinup + # run: docker ps -a + - name: Run tests + run: cargo test --verbose + # - name: Stop containers + # if: ${{ always() }} + # run: docker-compose down + build_image: + # The type of runner that the job will run on + runs-on: amd64 + needs: [test, build, format-check] + if: ${{ false }} # Disable for the template, users should opt into enabling the job + #if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development' || startsWith(github.ref, 'refs/tags/v') + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repsitory under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + with: + token: ${{secrets.BOT_SUBMODULE_TOKEN}} + submodules: recursive + - uses: webfactory/ssh-agent@v0.5.0 + with: + ssh-private-key: ${{ secrets.MACHINE_USER_SSH_KEY }} + - name: Inject slug/short variables + uses: rlespinasse/github-slug-action@v3.x + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + install: true + driver-opts: network=host + + - name: Login to Harbor + uses: docker/login-action@v1 + with: + registry: harbor.prod-aws.phylum.dev + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + - name: Build and push Docker images + # You may pin to the exact commit or the version. + # uses: docker/build-push-action@4a531fa5a603bab87dfa56578bd82b28508c9547 + uses: docker/build-push-action@v2.2.2 + with: + # Build's context is the set of files located in the specified PATH or URL + context: # SET ME + # Path to the Dockerfile + file: # optional + # List of build-time variables + build-args: + # List of metadata for an image + labels: # optional + # List of tags + tags: # SET ME harbor.prod-aws.phylum.dev/phylum/NAME_HERE:${{ env.GITHUB_REF_SLUG }} + # Always attempt to pull a newer version of the image + pull: true + # Sets the target stage to build + target: # optional + # Do not use cache when building the image + no-cache: # optional, default is false + # List of target platforms for build + platforms: # optional + # Load is a shorthand for --output=type=docker + load: # optional, default is false + # Push is a shorthand for --output=type=registry + push: true + # List of output destinations (format: type=local,dest=path) + outputs: # optional + # List of external cache sources for buildx (eg. user/app:cache, type=local,src=path/to/dir) + cache-from: type=registry,ref=harbor.prod-aws.phylum.dev/phylum/phylum-janusgraph:${{ env.GITHUB_REF_SLUG }} + # List of cache export destinations for buildx (eg. user/app:cache, type=local,dest=path/to/dir) + cache-to: type=inline + # List of secrets to expose to the build (eg. key=value, GIT_AUTH_TOKEN=mytoken) + secrets: # optional + # GitHub Token used to authenticate against a repository for Git context + github-token: # optional, default is ${{ github.token }} + ssh: default diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2e1dcd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,104 @@ +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +**/*.envrc + +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + +# Created by https://www.toptal.com/developers/gitignore/api/vim,macos,linux,visualstudiocode +# Edit at https://www.toptal.com/developers/gitignore?templates=vim,macos,linux,visualstudiocode + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +# Support for Project snippet scope +!.vscode/*.code-snippets + +# End of https://www.toptal.com/developers/gitignore/api/vim,macos,linux,visualstudiocode diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..c2b9b00 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "repo-template" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/README.md b/README.md new file mode 100644 index 0000000..062a800 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# Project Name + +## Introduction + +## Manually Starting Integration Testing Environment + +## Running + diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}