generated from PlexSheep/rs-base
Compare commits
4 commits
Author | SHA1 | Date | |
---|---|---|---|
|
ad9b0197c8 | ||
fd164fc978 | |||
a7147d50ac | |||
|
2c5ebf25a3 |
11 changed files with 74 additions and 88 deletions
7
.github/dependabot.yaml
vendored
Normal file
7
.github/dependabot.yaml
vendored
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
# Check for updates every Monday
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
12
.github/workflows/cargo.yaml
vendored
12
.github/workflows/cargo.yaml
vendored
|
@ -1,10 +1,16 @@
|
||||||
name: cargo devel CI
|
name: Rust CI
|
||||||
on:
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- '**'
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- '**'
|
- '**'
|
||||||
# - '!master'
|
# - '!master'
|
||||||
|
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
CI:
|
CI:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -38,10 +44,10 @@ jobs:
|
||||||
- name: cargo fmt
|
- name: cargo fmt
|
||||||
run: cargo fmt --all
|
run: cargo fmt --all
|
||||||
- name: cargo test
|
- name: cargo test
|
||||||
run: cargo test --all-features --all-targets --workspace && cargo test --all-features --workspace --doc
|
run: cargo test --all-features --all-targets --workspace
|
||||||
- name: commit back to repository
|
- name: commit back to repository
|
||||||
uses: stefanzweifel/git-auto-commit-action@v5
|
uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
with:
|
with:
|
||||||
# Optional. Commit message for the created commit.
|
# Optional. Commit message for the created commit.
|
||||||
# Defaults to "Apply automatic changes"
|
# Defaults to "Apply automatic changes"
|
||||||
commit_message: automatic cargo CI changes
|
commit_message: "ci: automatic Rust CI changes"
|
||||||
|
|
54
.github/workflows/release.yaml
vendored
Normal file
54
.github/workflows/release.yaml
vendored
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
name: Release-plz
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
# Release unpublished packages.
|
||||||
|
release-plz-release:
|
||||||
|
name: Release-plz release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
- name: Run release-plz
|
||||||
|
uses: MarcoIeni/release-plz-action@v0.5
|
||||||
|
with:
|
||||||
|
command: release
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
# Create a PR with the new versions and changelog, preparing the next release.
|
||||||
|
release-plz-pr:
|
||||||
|
name: Release-plz PR
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
concurrency:
|
||||||
|
group: release-plz-${{ github.ref }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
- name: Run release-plz
|
||||||
|
uses: MarcoIeni/release-plz-action@v0.5
|
||||||
|
with:
|
||||||
|
command: release-pr
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
@ -64,11 +64,3 @@ test-log = { version = "0.2.16", default-features = false, features = [
|
||||||
"color",
|
"color",
|
||||||
"trace",
|
"trace",
|
||||||
] }
|
] }
|
||||||
|
|
||||||
[[bench]]
|
|
||||||
name = "solver_naive"
|
|
||||||
harness = false
|
|
||||||
|
|
||||||
[[bench]]
|
|
||||||
name = "solver_stupid"
|
|
||||||
harness = false
|
|
||||||
|
|
|
@ -26,6 +26,5 @@ have to guess words by slowly guessing the letters contained in it.
|
||||||
Included in this repository are the following wordlists:
|
Included in this repository are the following wordlists:
|
||||||
|
|
||||||
<!-- TODO: make sure this is properly cited -->
|
<!-- TODO: make sure this is properly cited -->
|
||||||
* [`./data/wordlists/en_US_3b1b_freq_map.json`](./data/wordlists/en_US_3b1b_freq_map.json) --- [3Blue1Brown Top English words](https://github.com/3b1b/videos/tree/master/_2022/wordle/data)
|
* [3Blue1Brown Top English words](./data/wordlists/german_SUBTLEX-DE.json) --- [`./data/wordlists/en_US_3b1b_freq_map.json`](https://github.com/3b1b/videos/tree/master/_2022/wordle/data)
|
||||||
* [`./data/wordlists/german_SUBTLEX-DE_full.json`](./data/wordlists/german_SUBTLEX-DE_full.json) --- [SUBTLEX-DE ~33.000 Common German Words](https://osf.io/py9ba/files/osfstorage)
|
* [~33.000 Common German Words](./data/wordlists/german_SUBTLEX-DE.json) --- [SUBTLEX-DE](https://osf.io/py9ba/files/osfstorage)
|
||||||
* [`./data/wordlists/german_SUBTLEX-DE_small.json`](./data/wordlists/german_SUBTLEX-DE_small.json) --- [SUBTLEX-DE ~33.000 Common German Words (reduced to most common)](https://osf.io/py9ba/files/osfstorage)
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
use wordle_analyzer::bench::builtin::BuiltinBenchmark;
|
|
||||||
use wordle_analyzer::bench::Benchmark;
|
|
||||||
use wordle_analyzer::game::{self, GameBuilder};
|
|
||||||
use wordle_analyzer::solve::{NaiveSolver, Solver};
|
|
||||||
use wordle_analyzer::wlist::builtin::BuiltinWList;
|
|
||||||
|
|
||||||
fn main() -> anyhow::Result<()> {
|
|
||||||
let wl = BuiltinWList::english(5);
|
|
||||||
let builder: GameBuilder<'_, BuiltinWList> = game::Game::builder(&wl)
|
|
||||||
.length(5)
|
|
||||||
.max_steps(6)
|
|
||||||
.precompute(true);
|
|
||||||
let solver: NaiveSolver<_> = NaiveSolver::build(&wl)?;
|
|
||||||
let bench = BuiltinBenchmark::build(&wl, solver, builder, 16)?;
|
|
||||||
bench.start(2000, &bench.builder())?;
|
|
||||||
println!("{}", bench.report());
|
|
||||||
Ok(())
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
use wordle_analyzer::bench::builtin::BuiltinBenchmark;
|
|
||||||
use wordle_analyzer::bench::Benchmark;
|
|
||||||
use wordle_analyzer::game::{self, GameBuilder};
|
|
||||||
use wordle_analyzer::solve::Solver;
|
|
||||||
use wordle_analyzer::solve::StupidSolver;
|
|
||||||
use wordle_analyzer::wlist::builtin::BuiltinWList;
|
|
||||||
|
|
||||||
fn main() -> anyhow::Result<()> {
|
|
||||||
let wl = BuiltinWList::english(5);
|
|
||||||
let builder: GameBuilder<'_, BuiltinWList> = game::Game::builder(&wl)
|
|
||||||
.length(5)
|
|
||||||
.max_steps(6)
|
|
||||||
.precompute(true);
|
|
||||||
let solver: StupidSolver<_> = StupidSolver::build(&wl)?;
|
|
||||||
let bench = BuiltinBenchmark::build(&wl, solver, builder, 16)?;
|
|
||||||
bench.start(2000, &bench.builder())?;
|
|
||||||
println!("{}", bench.report());
|
|
||||||
Ok(())
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
cargo check --all-features
|
|
||||||
echo ">>>>>>>> PUBLISHING RELEASE FOR REPO"
|
|
||||||
bash scripts/release.sh
|
|
||||||
echo ">>>>>>>> PUBLISHING TO CRATES.IO NEXT"
|
|
||||||
sleep 2
|
|
||||||
cargo publish
|
|
||||||
echo ">>>>>>>> PUBLISHING TO CSCHERR.DE NEXT"
|
|
||||||
sleep 2
|
|
||||||
cargo publish --registry cscherr
|
|
|
@ -1,24 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
TOKEN=$(cat ~/.git-credentials | grep 'git.cscherr.de' | grep -P '(?:)[^:]*(?=@)' -o)
|
|
||||||
NEW_VERSION=$(cat Cargo.toml | rg '^\s*version\s*=\s*"([^"]*)"\s*$' -or '$1')
|
|
||||||
GIT_COMMIT_SHA=$(git rev-parse HEAD)
|
|
||||||
REPO=${PWD##*/} # name of cwd
|
|
||||||
BODY="
|
|
||||||
$(git log $(git describe --tags --abbrev=0)..HEAD --pretty="- %s" --oneline --decorate)
|
|
||||||
"
|
|
||||||
USER=PlexSheep
|
|
||||||
git tag "v$NEW_VERSION" || echo "could not tag"
|
|
||||||
curl -X 'POST' \
|
|
||||||
'https://git.cscherr.de/api/v1/repos/PlexSheep/'$REPO'/releases' \
|
|
||||||
-H 'accept: application/json' \
|
|
||||||
-H "Authorization: token $TOKEN" \
|
|
||||||
-H 'Content-Type: application/json' \
|
|
||||||
-d '{
|
|
||||||
"body": "'"$BODY"'",
|
|
||||||
"draft": false,
|
|
||||||
"name": "v'$NEW_VERSION'",
|
|
||||||
"prerelease": true,
|
|
||||||
"tag_name": "v'$NEW_VERSION'",
|
|
||||||
"target_commitish": "'$GIT_COMMIT_SHA'"
|
|
||||||
}' | python -m json.tool
|
|
||||||
git push || echo "could not push"
|
|
|
@ -349,7 +349,7 @@ impl<'wl, WL: WordList> GameBuilder<'wl, WL> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'wl, WL: WordList> Display for Game<'wl, WL> {
|
impl<WL: WordList> Display for Game<'_, WL> {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
// TODO: make this actually useful
|
// TODO: make this actually useful
|
||||||
// TODO: make this actually fancy
|
// TODO: make this actually fancy
|
||||||
|
|
|
@ -6,7 +6,7 @@ pub struct Summary<'wl, WL: WordList> {
|
||||||
data: Vec<&'wl Game<'wl, WL>>,
|
data: Vec<&'wl Game<'wl, WL>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'wl, WL: WordList> Default for Summary<'wl, WL> {
|
impl<WL: WordList> Default for Summary<'_, WL> {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self::new()
|
Self::new()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue