Skip to content

Commit

Permalink
Cleanup history
Browse files Browse the repository at this point in the history
History before this point will now be a little wonky.

Windsock started off being developed in the shotover repo:
https://github.com/shotover/shotover-proxy
But as of this commit development is continuing in a seperate repo.

I ran `git-filter-repo --path windsock` to clean out all shotover
specific history.
And then I reintroduced a few files such as the workspace Cargo.toml in
this commit.

This comes at the cost of the previous commits being unbuildable.
But this project is not large enough to need reproducible commits
at this point in time.
And I think removing the 1000+ shotover specific commits is worth it.
  • Loading branch information
rukai committed Mar 12, 2024
1 parent 893daaa commit c8016f1
Show file tree
Hide file tree
Showing 13 changed files with 2,269 additions and 2 deletions.
106 changes: 106 additions & 0 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Build and Test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Cancel already running jobs
concurrency:
group: build_and_test_${{ github.head_ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

jobs:
build_check_and_upload:
strategy:
fail-fast: false
matrix:
include:
- name: Build Release
runner: ubuntu-20.04
cargo_flags: --release
profile: release

- name: Build Debug
runner: ubuntu-20.04
cargo_flags:
profile: debug

name: ${{ matrix.name }}
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
# rust-cache already handles all the sane defaults for caching rust builds.
# However because we are running seperate debug/release builds in parallel,
# we also need to add the runner and cargo_flags to the key so that a seperate cache is used.
# Otherwise only the last build to finish would get saved to the cache.
# We allow different test_flags to share a cache as they should have identical build outputs
key: ${{ matrix.runner }} - ${{ matrix.cargo_flags }}
# this line means that only the main branch writes to the cache
# benefits:
# * prevents main branch caches from being evicted in favor of a PR cache
# * saves about 1min per workflow by skipping the actual cache write
# downsides:
# * PRs that update rust version or changes deps will be slow to iterate on due to changes not being cached.
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Install nextest
uses: taiki-e/install-action@v2
with:
tool: [email protected]
- name: Build tests
run: |
cargo test --doc ${{ matrix.cargo_flags }} --all-features -- --show-output --nocapture
cargo nextest archive --archive-file nextest-${{ matrix.profile }}.tar.zst ${{ matrix.cargo_flags }} --all-features --all-targets
- name: Upload built tests to workflow
uses: actions/upload-artifact@v4
with:
name: nextest-${{ matrix.profile }}
path: nextest-${{ matrix.profile }}.tar.zst
- name: Cleanup archive
run: rm nextest-${{ matrix.profile }}.tar.zst
- name: Ensure that tests did not create or modify any files that arent .gitignore'd
run: |
if [ -n "$(git status --porcelain)" ]; then
git status
exit 1
fi
run_tests_partitioned:
strategy:
fail-fast: false
matrix:
partition: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
profile: ["release", "debug"]
name: Test ${{ matrix.profile}} ${{ matrix.partition }}/15
runs-on: ubuntu-latest
needs: build_check_and_upload
steps:
- uses: actions/checkout@v4
- name: Install nextest
uses: taiki-e/install-action@v2
with:
tool: [email protected]
- run: mkdir -p ~/.cargo/bin
- name: Download archive
uses: actions/download-artifact@v4
with:
name: nextest-${{ matrix.profile }}
- name: Run tests
run: |
~/.cargo/bin/cargo-nextest nextest run --archive-file nextest-${{ matrix.profile }}.tar.zst \
--partition count:${{ matrix.partition }}/15 --extract-to . --run-ignored all
- name: Cleanup archive
run: rm nextest-${{ matrix.profile }}.tar.zst
- name: Ensure that tests did not create or modify any files that arent .gitignore'd
run: |
if [ -n "$(git status --porcelain)" ]; then
git status
exit 1
fi
25 changes: 25 additions & 0 deletions .github/workflows/license_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: License Check

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Cancel already running jobs
concurrency:
group: license_check_${{ github.head_ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

jobs:
license_check:
runs-on: ubuntu-latest
name: License Check
steps:
- uses: actions/checkout@v4
- run: cargo install --locked cargo-deny
- run: cargo deny check licenses
49 changes: 49 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Formatting and lints

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Cancel already running jobs
concurrency:
group: lints_${{ github.head_ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

jobs:
job:
name: Formatting and lints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
# this line means that only the main branch writes to the cache
# benefits:
# * prevents main branch caches from being evicted in favor of a PR cache
# * saves about 1min per workflow by skipping the actual cache write
# downsides:
# * PRs that update rust version or changes deps will be slow to iterate on due to changes not being cached.
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Install cargo-hack
uses: taiki-e/install-action@v2
with:
tool: [email protected]
- name: Ensure `cargo fmt --all` was run
run: cargo fmt --all -- --check
- name: Ensure that all crates compile and have no warnings under every possible combination of features
# some things to explicitly point out:
# * clippy also reports rustc warnings and errors
# * clippy --all-targets causes clippy to run against tests and examples which it doesnt do by default.
run: cargo hack --feature-powerset --at-least-one-of redis,cassandra,kafka,opensearch clippy --all-targets --locked -- -D warnings
- name: Ensure that tests did not create or modify any files that arent .gitignore'd
run: |
if [ -n "$(git status --porcelain)" ]; then
git status
exit 1
fi
20 changes: 20 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: "tagged-release"

on:
push:
tags:
- "v*"

jobs:
publish-crates-io:
name: "Publish to crates.io"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Publish
run: |
cd windsock
cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_TOKEN }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/target
.idea/
/.vscode
**/.DS_Store
/.project
Loading

0 comments on commit c8016f1

Please sign in to comment.