-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cookies, hashing, retries, redis improvements (#50)
* Tmp * Tmp * Few new features * Fix * Fix * Fix
- Loading branch information
Showing
30 changed files
with
2,488 additions
and
564 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Setup Python | ||
description: "Installs python, setting up caching." | ||
inputs: | ||
pdm: | ||
description: "Whether pdm/python packages need installing as well as base python or not." | ||
required: false | ||
default: "false" | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Hack setup-python cache | ||
# Create an empty requirements.txt if this file (or pyproject.toml) doesn't exist. | ||
# This work around and issue with setup-python for non-Python projects, which ends up with ends up | ||
# with this error: | ||
# | ||
# Run actions/[email protected] | ||
# with: | ||
# python-version: 3.12 | ||
# cache: pip | ||
# Installed versions | ||
# Successfully set up CPython (3.12.1) | ||
# Error: No file in /home/runner/work/awesome-iam/awesome-iam matched to | ||
# [**/requirements.txt or **/pyproject.toml], make sure you have checked out the target repository | ||
# | ||
# This has been reported at: https://github.com/actions/setup-python/issues/807 | ||
# In the future this might be addressed by: https://github.com/actions/setup-python/pull/762 | ||
# or https://github.com/actions/setup-python/issues/751 | ||
if: hashFiles('**/requirements.txt', '**/pyproject.toml') == '' | ||
shell: bash | ||
run: | | ||
touch ./requirements.txt | ||
- name: Get python binary | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12" | ||
cache: pip | ||
- name: Always install zetch | ||
shell: bash | ||
run: | | ||
pip install zetch | ||
- uses: actions/checkout@v4 | ||
if: ${{ inputs.pdm == 'true' }} | ||
- name: Set up PDM | ||
if: ${{ inputs.pdm == 'true' }} | ||
uses: pdm-project/setup-pdm@v3 | ||
with: | ||
python-version: "3.12" | ||
cache: true | ||
cache-dependency-path: 'py/pdm.lock' | ||
- name: Install dependencies | ||
if: ${{ inputs.pdm == 'true' }} | ||
shell: bash | ||
run: | | ||
pdm sync -p ./py -G:all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: install redis | ||
description: "install redis without starting a server (ONLY IF NOT WINDOWS)" | ||
runs: | ||
using: composite | ||
steps: | ||
- uses: shogo82148/actions-setup-redis@v1 | ||
if: runner.os != 'Windows' | ||
with: | ||
redis-version: "latest" | ||
auto-start: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
name: Setup Rust | ||
description: "Installs latest stable rust, and sets up sscache for caching." | ||
inputs: | ||
secret_config_toml: | ||
description: "The CUSTOM_RUST_CONFIG_TOML secret if it exists." | ||
qa: | ||
description: "Whether things like cargo-hack need installing." | ||
required: false | ||
|
@@ -16,22 +18,33 @@ runs: | |
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: rustfmt, clippy | ||
# This will store compiled crates, allowing them to be reused between runs. | ||
# The action caller will have a post job setup that will print a summary of sccache usage during the run. | ||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
- name: Set Rust caching env vars | ||
shell: bash | ||
run: | | ||
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV | ||
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV | ||
# Really this would need to be run as a post task to be of any use (to actually see hits), | ||
# but post in composite action not currently supported: | ||
# https://github.com/actions/runner/issues/1478 | ||
# - name: Run sccache stat for check | ||
# shell: bash | ||
# run: ${SCCACHE_PATH} --show-stats | ||
- name: "Install cargo-hack, used for feature checking in pre-commit." | ||
if: ${{ inputs.qa == 'true' }} | ||
uses: taiki-e/install-action@cargo-hack | ||
- name: Install nextest | ||
if: ${{ inputs.test == 'true' }} | ||
uses: taiki-e/install-action@nextest | ||
- name: Setup default global config.toml | ||
shell: bash | ||
if: ${{ inputs.secret_config_toml == '' }} | ||
run: | | ||
mkdir -p ~/.cargo | ||
echo '[build]' > ~/.cargo/config.toml | ||
echo '[registries]' >> ~/.cargo/config.toml | ||
# If CUSTOM_RUST_CONFIG_TOML is set, it will be copied to the global config.toml | ||
- name: Setup custom global config.toml | ||
shell: bash | ||
if: ${{ inputs.secret_config_toml != '' }} | ||
run: | | ||
mkdir -p ~/.cargo | ||
echo '${{ inputs.secret_config_toml }}' > ~/.cargo/config.toml | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.