Skip to content

Commit 83ad29b

Browse files
committed
Add files
1 parent 736157a commit 83ad29b

File tree

140 files changed

+242799
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+242799
-0
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @PaulKMueller @pavelzw

.github/PULL_REQUEST_TEMPLATE.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Motivation
2+
3+
<!-- Why is this change necessary? Link issues here if applicable. -->
4+
5+
# Changes
6+
7+
<!-- What changes have been performed? -->
169 KB
Loading
108 KB
Loading

.github/assets/demo/demo-dark.gif

429 KB
Loading

.github/assets/demo/demo-dark.mp4

304 KB
Binary file not shown.

.github/assets/demo/demo-dark.tape

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Output .github/assets/demo/demo-dark.mp4
2+
Output .github/assets/demo/demo-dark.gif
3+
4+
Set Theme "3024 Night"
5+
Set Shell "bash"
6+
Set FontSize 32
7+
Set Width 1920
8+
Set Height 750
9+
10+
Hide
11+
Type "cd tests/test_end_to_end/test_default_use_case" Enter
12+
Type "clear" Enter
13+
14+
Show
15+
Type@150ms "ls" Sleep 1s Enter
16+
Sleep 3s
17+
18+
Type@150ms "conda-deny --help" Sleep 1s Enter
19+
Sleep 5s
20+
21+
Type "clear" Sleep 1s Enter
22+
Sleep 3s
23+
24+
Type "cat license_whitelist.toml" Sleep 1s Enter
25+
Sleep 3s
26+
27+
Type@150ms "conda-deny check" Sleep 1s Enter
28+
Sleep 6s

.github/assets/demo/demo-light.gif

567 KB
Loading

.github/assets/demo/demo-light.mp4

329 KB
Binary file not shown.

.github/assets/demo/demo-light.tape

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Output .github/assets/demo/demo-light.mp4
2+
Output .github/assets/demo/demo-light.gif
3+
4+
Set Theme "3024 Day"
5+
Set Shell "bash"
6+
Set FontSize 32
7+
Set Width 2020
8+
Set Height 750
9+
10+
Hide
11+
Type "cd tests/test_end_to_end/test_default_use_case" Enter
12+
Type "clear" Enter
13+
14+
Show
15+
Type@150ms "ls" Sleep 1s Enter
16+
Sleep 3s
17+
18+
Type@150ms "conda-deny --help" Sleep 1s Enter
19+
Sleep 5s
20+
21+
Type "clear" Sleep 1s Enter
22+
Sleep 3s
23+
24+
Type "cat license_whitelist.toml" Sleep 1s Enter
25+
Sleep 3s
26+
27+
Type@150ms "conda-deny check" Sleep 1s Enter
28+
Sleep 6s

.github/dependabot.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: monthly
7+
reviewers:
8+
- PaulKMueller
9+
groups:
10+
gh-actions:
11+
patterns:
12+
- "*"
13+
commit-message:
14+
prefix: ci
15+
- package-ecosystem: cargo
16+
directory: /
17+
schedule:
18+
interval: monthly
19+
groups:
20+
rust-dependencies:
21+
patterns:
22+
- "*"
23+
commit-message:
24+
prefix: build
25+
labels:
26+
- dependencies

.github/release.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- ignore for release
5+
categories:
6+
- title: 🚨 Breaking changes
7+
labels:
8+
- breaking
9+
- title: ✨ New features
10+
labels:
11+
- enhancement
12+
- title: 🚀 Performance
13+
labels:
14+
- performance
15+
- title: 🐛 Bug fixes
16+
labels:
17+
- bug
18+
- fix
19+
- title: 📝 Documentation
20+
labels:
21+
- documentation
22+
- title: 🧪 Tests
23+
labels:
24+
- test
25+
- title: ⬆️ Dependencies
26+
labels:
27+
- dependencies
28+
- title: 🤖 CI
29+
labels:
30+
- ci
31+
- title: 🏗️ Refactor
32+
labels:
33+
- refactor
34+
- title: 🤷🏻 Other changes
35+
labels:
36+
- "*"

.github/workflows/build.yml

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: Binary Build
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
10+
jobs:
11+
metadata:
12+
name: Check if version changed
13+
runs-on: ubuntu-latest
14+
outputs:
15+
optimize-build: ${{ github.event_name == 'push' }}
16+
release: ${{ github.repository == 'Quantco/conda-deny' && steps.version-metadata.outputs.changed == 'true' }}
17+
version: ${{ steps.version-metadata.outputs.newVersion }}
18+
steps:
19+
- name: Checkout source code
20+
uses: actions/checkout@v4
21+
- uses: Quantco/ui-actions/version-metadata@a0653e9fc0ee3c4be9f7cc88e509e40536e9f3c1
22+
id: version-metadata
23+
with:
24+
file: ./Cargo.toml
25+
token: ${{ secrets.GITHUB_TOKEN }}
26+
version-extraction-override: 'regex:version = "(.*)"'
27+
28+
build:
29+
name: Build Binary (${{ matrix.target }})
30+
runs-on: ${{ matrix.os }}
31+
needs: [metadata]
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
include:
36+
- target: x86_64-unknown-linux-musl
37+
os: ubuntu-latest
38+
cross: true
39+
- target: aarch64-unknown-linux-musl
40+
os: ubuntu-latest
41+
cross: true
42+
- target: x86_64-unknown-linux-gnu
43+
os: ubuntu-latest
44+
cross: true
45+
- target: aarch64-unknown-linux-gnu
46+
os: ubuntu-latest
47+
cross: true
48+
- target: x86_64-pc-windows-msvc
49+
os: windows-latest
50+
cross: false
51+
- target: aarch64-apple-darwin
52+
os: macos-latest
53+
cross: false
54+
- target: x86_64-apple-darwin
55+
os: macos-13
56+
cross: false
57+
env:
58+
# These are some environment variables that configure the build so that the binary size is reduced.
59+
# Inspiration was taken from this blog: https://arusahni.net/blog/2020/03/optimizing-rust-binary-size.html
60+
# They only enable it on main and releases.
61+
62+
# Enable Link Time Optimization (LTO) for our release builds. This increases link time but drastically reduces
63+
# binary size.
64+
CARGO_PROFILE_RELEASE_LTO: ${{ needs.metadata.outputs.optimize-build }}
65+
66+
# Use a single code gen unit. This effectively disables parallel linking but ensures that everything is linked
67+
# together in a single unit which reduces the file-size at the cost of link time.
68+
# Default for a release build is 16
69+
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: ${{ needs.metadata.outputs.optimize-build && 1 || 16 }}
70+
71+
# Strip the binaries. This reduces the filesize of the final release.
72+
CARGO_PROFILE_RELEASE_STRIP: ${{ needs.metadata.outputs.optimize-build && 'symbols' || 'false' }}
73+
74+
# Optimize the binary for size. This reduces the filesize at the cost of a slower binary.
75+
CARGO_PROFILE_OPT_LEVEL: ${{ needs.metadata.outputs.optimize-build && 's' || '0' }}
76+
steps:
77+
- name: Checkout source code
78+
uses: actions/checkout@v4
79+
80+
- uses: dtolnay/rust-toolchain@stable
81+
with:
82+
targets: ${{ matrix.target }}
83+
84+
- name: Rust cache
85+
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84
86+
with:
87+
key: build-${{ matrix.target }}-${{ needs.metadata.outputs.optimize-build }}-${{ matrix.cross }}-${{ matrix.os }}
88+
89+
- name: Install cross
90+
if: matrix.cross
91+
run: cargo install cross --git https://github.com/cross-rs/cross
92+
93+
- name: Build
94+
run: |
95+
${{ matrix.cross && 'cross' || 'cargo' }} build --release --color always${{ endsWith(matrix.target, 'musl') && ' --no-default-features --features rustls-tls' || '' }} --target ${{ matrix.target }}
96+
mv target/${{ matrix.target }}/release/conda-deny${{ endsWith(matrix.target, 'windows-msvc') && '.exe' || '' }} conda-deny-${{ matrix.target }}${{ endsWith(matrix.target, 'windows-msvc') && '.exe' || '' }}
97+
98+
- name: Upload Artifact
99+
uses: actions/upload-artifact@v4
100+
with:
101+
name: conda-deny-${{ matrix.target }}
102+
path: conda-deny-${{ matrix.target }}${{ endsWith(matrix.target, 'windows-msvc') && '.exe' || '' }}
103+
if-no-files-found: error
104+
105+
release:
106+
name: Create Release
107+
needs: [metadata, build]
108+
if: ${{ needs.metadata.outputs.release == 'true' && github.ref == 'refs/heads/main' }}
109+
runs-on: ubuntu-latest
110+
steps:
111+
- name: Checkout source code
112+
uses: actions/checkout@v4
113+
with:
114+
token: ${{ secrets.TAG_TOKEN }}
115+
- name: Download artifacts
116+
uses: actions/download-artifact@v4
117+
with:
118+
pattern: conda-deny-*
119+
merge-multiple: true
120+
- name: Push v${{ needs.metadata.outputs.version }} tag
121+
run: |
122+
git tag v${{ needs.metadata.outputs.version }}
123+
git push origin v${{ needs.metadata.outputs.version }}
124+
- name: Create Release
125+
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
126+
with:
127+
generate_release_notes: true
128+
tag_name: v${{ needs.metadata.outputs.version }}
129+
draft: false
130+
files: conda-deny-*

.github/workflows/ci.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Cargo Build, Test & Lint
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
pull_request:
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
# Colored output by the CLI should be colored in Github Actions
12+
CLICOLOR_FORCE: 1
13+
# Make sure CI fails on all warnings, including Clippy lints
14+
RUSTFLAGS: "-Dwarnings"
15+
16+
jobs:
17+
build_and_test:
18+
name: Rust project - latest
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
toolchain:
23+
- stable
24+
- beta
25+
- nightly
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84
29+
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
30+
- run: cargo build --verbose
31+
- run: cargo test --verbose
32+
33+
clippy:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84
38+
- name: Run Clippy
39+
run: cargo clippy --all-targets --all-features -- -D clippy::all

.github/workflows/coverage.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: coverage
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
env:
8+
# Colored output by the CLI should be colored in Github Actions
9+
CLICOLOR_FORCE: 1
10+
jobs:
11+
test:
12+
name: coverage
13+
runs-on: ubuntu-latest
14+
container:
15+
image: xd009642/tarpaulin:develop-nightly
16+
options: --security-opt seccomp=unconfined
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Generate code coverage
22+
run: |
23+
cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 120 --out xml
24+
25+
- name: Upload to codecov.io
26+
uses: codecov/codecov-action@v4
27+
with:
28+
token: ${{ secrets.CODECOV_TOKEN }}
29+
fail_ci_if_error: true

0 commit comments

Comments
 (0)