Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jssblck authored Dec 7, 2023
0 parents commit 919f2eb
Show file tree
Hide file tree
Showing 14 changed files with 856 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Overview

_Provide an overview of this change. Describe the intent of this change, and how it implements that intent._

_Example: This PR accomplishes X by doing Y._

## Acceptance criteria

_If this PR is successful, what impact does it have on the user experience?_

_Example: When users do X, Y should now happen._

## Testing plan

_How did you validate that this PR works? What literal steps did you take when manually checking that your code works?_

_Example:_

1. _Set up test case X._
2. _Run command Y. Make sure Z happens._

_This section should list concrete steps that a reviewer can sanity check and repeat on their own machine (and provide any needed test cases)._

## Metrics

_How are we monitoring this change?_

## Risks

_Highlight any areas that you're unsure of, want feedback on, or want reviewers to pay particular attention to._

_Example: I'm not sure I did X correctly, can reviewers please double-check that for me?_

## References

_Add links to any referenced GitHub issues, Zendesk tickets, Jira tickets, Slack threads, etc._

_Example:_

- _[ANE-123](https://fossa.atlassian.net/browse/ANE-123): Implement X._

## Checklist

- [ ] I added tests for this PR's change (or explained in the PR description why tests don't make sense).
18 changes: 18 additions & 0 deletions .github/workflows/check-dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: dependencies
on: push

jobs:
check-fossa:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- run: "curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash"

- run: fossa analyze --only-target cargo .
env:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}

- run: fossa test
env:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
62 changes: 62 additions & 0 deletions .github/workflows/check-dynamic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: dynamic

on: pull_request

jobs:
# Note: this builds on Windows using the MinGW toolchain, to enable cross compilation.
# If interoperability with Windows debugging tools or binaries (e.g. dlls) is important,
# the repo should probably run a dedicated Windows runner and use `x86_64-pc-windows-msvc`.
check-build:
strategy:
matrix:
target: [x86_64-unknown-linux-gnu, x86_64-pc-windows-gnu, aarch64-unknown-linux-gnu]

runs-on: ubuntu-latest
name: check-build / ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cross
- uses: Swatinem/[email protected]
with:
key: ${{ matrix.target }}

- run: cross build --all-targets --target ${{ matrix.target }}

# We can't easily cross compile to macOS, since Cross doesn't ship a docker image for this target.
check-build-macos:
strategy:
matrix:
target: [x86_64-apple-darwin, aarch64-apple-darwin]

runs-on: macos-latest
name: check-build / ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/[email protected]
with:
key: ${{ matrix.target }}

- run: rustup target add ${{ matrix.target }}
- run: cargo build --all-targets --target ${{ matrix.target }}

# Unfortunately, while we can cross compile, we can't easily run tests cross platform.
# Cross _can_ run them, but runs through qemu.
# This makes things very slow at best, and buggy at worst.
check-test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}
name: check-test / ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@nextest
- uses: Swatinem/[email protected]

- run: cargo check --release --all --bins --examples --tests
- run: cargo nextest run --all-targets
- run: cargo test --doc
13 changes: 13 additions & 0 deletions .github/workflows/check-static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: static

on: pull_request

jobs:
check-static:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

- run: cargo fmt --all -- --check
- run: cargo clippy --all-features --all --tests -- -D clippy::all
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# 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

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb


# Added by cargo

/target
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"cSpell.words": [
"aarch",
"clippy",
"CODEOWNER",
"CODEOWNERS",
"doctest",
"doctests",
"dtolnay",
"libc",
"msvc",
"nextest",
"rustup",
"Swatinem",
"taiki"
]
}
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "template-rust"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Loading

0 comments on commit 919f2eb

Please sign in to comment.