mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.85.2 to 2.85.11. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/41049aa56687c35e0afa74eed4f09cec4f9afabf...7f4eb899022d8fe70b20c4f3de697aa85c309026) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-version: 2.85.11 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
224 lines
8.4 KiB
YAML
224 lines
8.4 KiB
YAML
name: Periodic checks/tasks
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 0 * * 6"
|
|
workflow_dispatch:
|
|
push:
|
|
paths:
|
|
- .github/workflows/cron-ci.yaml
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
paths:
|
|
- .github/workflows/cron-ci.yaml
|
|
|
|
env:
|
|
CARGO_ARGS: --no-default-features --features stdlib,importlib,stdio,encodings,ssl-rustls-aws-lc,jit,host_env
|
|
|
|
jobs:
|
|
# codecov collects code coverage data from the rust tests, python snippets and python test suite.
|
|
# This is done using cargo-llvm-cov, which is a wrapper around llvm-cov.
|
|
codecov:
|
|
name: Collect code coverage data
|
|
runs-on: ubuntu-latest
|
|
# Disable this scheduled job when running on a fork.
|
|
if: ${{ github.repository == 'RustPython/RustPython' || github.event_name != 'schedule' }}
|
|
env:
|
|
INSTA_WORKSPACE_ROOT: ${{ github.workspace }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
- uses: taiki-e/install-action@7f4eb899022d8fe70b20c4f3de697aa85c309026 # v2.85.11
|
|
with:
|
|
tool: cargo-llvm-cov
|
|
|
|
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
|
|
- run: sudo apt-get update && sudo apt-get -y install lcov
|
|
|
|
- name: Run cargo-llvm-cov with Rust tests.
|
|
run: cargo llvm-cov --no-report --workspace --exclude rustpython_wasm --exclude rustpython-compiler-source --exclude rustpython-venvlauncher --verbose --no-default-features --features stdlib,importlib,stdio,encodings,ssl-rustls-aws-lc,jit,host_env
|
|
|
|
- name: Run cargo-llvm-cov with Python snippets.
|
|
run: python scripts/cargo-llvm-cov.py
|
|
continue-on-error: true
|
|
|
|
- name: Run cargo-llvm-cov with Python test suite.
|
|
run: cargo llvm-cov --no-report run -- -m test -u all --slowest --fail-env-changed
|
|
continue-on-error: true
|
|
|
|
- name: Prepare code coverage data
|
|
run: cargo llvm-cov report --lcov --output-path='codecov.lcov'
|
|
|
|
- name: Upload to Codecov
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
|
|
with:
|
|
files: ./codecov.lcov
|
|
|
|
testdata:
|
|
name: Collect regression test data
|
|
runs-on: ubuntu-latest
|
|
# Disable this scheduled job when running on a fork.
|
|
if: ${{ github.repository == 'RustPython/RustPython' || github.event_name != 'schedule' }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: true
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: build rustpython
|
|
run: cargo build --release --verbose
|
|
|
|
- name: collect tests data
|
|
run: cargo run --release extra_tests/jsontests.py
|
|
env:
|
|
RUSTPYTHONPATH: ${{ github.workspace }}/Lib
|
|
|
|
- name: upload tests data to the website
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
env:
|
|
SSHKEY: ${{ secrets.ACTIONS_TESTS_DATA_DEPLOY_KEY }}
|
|
run: |
|
|
echo "$SSHKEY" >~/github_key
|
|
chmod 600 ~/github_key
|
|
export GIT_SSH_COMMAND="ssh -i ~/github_key"
|
|
|
|
git clone git@github.com:RustPython/rustpython.github.io.git website
|
|
cd website
|
|
cp ../extra_tests/cpython_tests_results.json ./_data/regrtests_results.json
|
|
git add ./_data/regrtests_results.json
|
|
if git -c user.name="Github Actions" -c user.email="actions@github.com" commit -m "Update regression test results"; then
|
|
git push
|
|
fi
|
|
|
|
whatsleft:
|
|
name: Collect what is left data
|
|
runs-on: ubuntu-latest
|
|
# Disable this scheduled job when running on a fork.
|
|
if: ${{ github.repository == 'RustPython/RustPython' || github.event_name != 'schedule' }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: true
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
|
|
- name: build rustpython
|
|
run: cargo build --release --verbose
|
|
|
|
- name: Collect what is left data
|
|
run: |
|
|
chmod +x ./scripts/whats_left.py
|
|
./scripts/whats_left.py --features "ssl,sqlite" > whats_left.temp
|
|
env:
|
|
RUSTPYTHONPATH: ${{ github.workspace }}/Lib
|
|
|
|
- name: Upload data to the website
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
env:
|
|
SSHKEY: ${{ secrets.ACTIONS_TESTS_DATA_DEPLOY_KEY }}
|
|
run: |
|
|
echo "$SSHKEY" >~/github_key
|
|
chmod 600 ~/github_key
|
|
export GIT_SSH_COMMAND="ssh -i ~/github_key"
|
|
|
|
git clone git@github.com:RustPython/rustpython.github.io.git website
|
|
cd website
|
|
[ -f ./_data/whats_left.temp ] && cp ./_data/whats_left.temp ./_data/whats_left_lastrun.temp
|
|
cp ../whats_left.temp ./_data/whats_left.temp
|
|
rm ./_data/whats_left/modules.csv
|
|
echo -e "module" > ./_data/whats_left/modules.csv
|
|
cat ./_data/whats_left.temp | grep "(entire module)" | cut -d ' ' -f 1 | sort >> ./_data/whats_left/modules.csv
|
|
awk -f - ./_data/whats_left.temp > ./_data/whats_left/builtin_items.csv <<'EOF'
|
|
BEGIN {
|
|
OFS=","
|
|
print "builtin,name,is_inherited"
|
|
}
|
|
/^# builtin items/ { in_section=1; next }
|
|
/^$/ { if (in_section) exit }
|
|
in_section {
|
|
split($1, a, ".")
|
|
rest = ""
|
|
idx = index($0, " ")
|
|
if (idx > 0) {
|
|
rest = substr($0, idx+1)
|
|
}
|
|
print a[1], $1, rest
|
|
}
|
|
EOF
|
|
git add -A
|
|
if git -c user.name="Github Actions" -c user.email="actions@github.com" commit -m "Update what is left results"; then
|
|
git push
|
|
fi
|
|
|
|
benchmark:
|
|
name: Collect benchmark data
|
|
runs-on: ubuntu-latest
|
|
# Disable this scheduled job when running on a fork.
|
|
if: ${{ github.repository == 'RustPython/RustPython' || github.event_name != 'schedule' }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: true
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
|
|
- run: cargo install cargo-criterion
|
|
|
|
- name: build benchmarks
|
|
run: cargo build --release --benches
|
|
|
|
- name: collect execution benchmark data
|
|
run: cargo criterion --bench execution
|
|
|
|
- name: collect microbenchmarks data
|
|
run: cargo criterion --bench microbenchmarks
|
|
|
|
- name: restructure generated files
|
|
run: |
|
|
cd ./target/criterion/reports
|
|
find . -type d -name cpython -print0 | xargs -0 rm -rf
|
|
find . -type d -name rustpython -print0 | xargs -0 rm -rf
|
|
find . -mindepth 2 -maxdepth 2 -name violin.svg -print0 | xargs -0 rm -rf
|
|
find . -type f -not -name violin.svg -print0 | xargs -0 rm -rf
|
|
find . -type f -name violin.svg -exec sh -c 'for file; do mv "$file" "$(echo "$file" | sed -E "s_\./([^/]+)/([^/]+)/violin\.svg_./\1/\2.svg_")"; done' _ {} +
|
|
find . -mindepth 2 -maxdepth 2 -type d -print0 | xargs -0 rm -rf
|
|
cd ..
|
|
mv reports/* .
|
|
rmdir reports
|
|
|
|
- name: upload benchmark data to the website
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
env:
|
|
SSHKEY: ${{ secrets.ACTIONS_TESTS_DATA_DEPLOY_KEY }}
|
|
COMMIT_SHA: ${{ github.sha }}
|
|
REF_NAME: ${{ github.ref_name }}
|
|
run: |
|
|
echo "$SSHKEY" >~/github_key
|
|
chmod 600 ~/github_key
|
|
export GIT_SSH_COMMAND="ssh -i ~/github_key"
|
|
|
|
git clone git@github.com:RustPython/rustpython.github.io.git website
|
|
cd website
|
|
rm -rf ./assets/criterion
|
|
cp -r ../target/criterion ./assets/criterion
|
|
printf '{\n "generated_at": "%s",\n "rustpython_commit": "%s",\n "rustpython_ref": "%s"\n}\n' \
|
|
"$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
|
|
"$COMMIT_SHA" \
|
|
"$REF_NAME" > ./_data/criterion-metadata.json
|
|
git add ./assets/criterion ./_data/criterion-metadata.json
|
|
if git -c user.name="Github Actions" -c user.email="actions@github.com" commit -m "Update benchmark results"; then
|
|
git push
|
|
fi
|