mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
158 lines
5.7 KiB
YAML
158 lines
5.7 KiB
YAML
on:
|
|
schedule:
|
|
- cron: '0 0 * * 6'
|
|
workflow_dispatch:
|
|
|
|
name: Periodic checks/tasks
|
|
|
|
jobs:
|
|
codecov:
|
|
name: Collect code coverage data
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: nightly
|
|
override: true
|
|
components: llvm-tools-preview
|
|
- run: sudo apt-get install lcov
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --release --verbose
|
|
env:
|
|
RUSTC_WRAPPER: './scripts/codecoverage-rustc-wrapper.sh'
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.8
|
|
- name: Install pipenv
|
|
run: |
|
|
python -V
|
|
python -m pip install --upgrade pip
|
|
python -m pip install pipenv
|
|
- run: pipenv install
|
|
working-directory: ./extra_tests
|
|
- name: run snippets
|
|
run: LLVM_PROFILE_FILE="$PWD/snippet-%p.profraw" pipenv run pytest -v
|
|
working-directory: ./extra_tests
|
|
- name: run cpython tests
|
|
run: LLVM_PROFILE_FILE="$PWD/regrtest.profraw" target/release/rustpython -m test -v
|
|
env:
|
|
RUSTPYTHONPATH: ${{ github.workspace }}/Lib
|
|
- name: prepare code coverage data
|
|
run: |
|
|
rusttool() {
|
|
local tool=$1; shift; "$(rustc --print target-libdir)/../bin/llvm-$tool" "$@"
|
|
}
|
|
rusttool profdata merge extra_tests/snippet-*.profraw regrtest.profraw --output codecov.profdata
|
|
rusttool cov export --instr-profile codecov.profdata target/release/rustpython --format lcov >codecov.lcov
|
|
lcov -r codecov.lcov '/*' -o codecov.lcov
|
|
- name: upload to Codecov
|
|
uses: codecov/codecov-action@v1
|
|
with:
|
|
file: ./codecov.lcov
|
|
|
|
testdata:
|
|
name: Collect regression test data
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: build rustpython
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --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
|
|
env:
|
|
SSHKEY: ${{ secrets.ACTIONS_TESTS_DATA_DEPLOY_KEY }}
|
|
GITHUB_ACTOR: ${{ github.actor }}
|
|
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
|
|
git -c user.name="Github Actions" -c user.email="actions@github.com" commit -m "Update regression test results" --author="$GITHUB_ACTOR"
|
|
git push
|
|
|
|
whatsleft:
|
|
name: Collect what is left data
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: build rustpython
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --release --verbose
|
|
- name: Collect what is left data
|
|
run: |
|
|
chmod +x ./whats_left.sh
|
|
./whats_left.sh > whats_left.temp
|
|
env:
|
|
RUSTPYTHONPATH: ${{ github.workspace }}/Lib
|
|
- name: Upload data to the website
|
|
env:
|
|
SSHKEY: ${{ secrets.ACTIONS_TESTS_DATA_DEPLOY_KEY }}
|
|
GITHUB_ACTOR: ${{ github.actor }}
|
|
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
|
|
git add -A
|
|
git -c user.name="Github Actions" -c user.email="actions@github.com" commit -m "Update what is left results" --author="$GITHUB_ACTOR"
|
|
git push
|
|
|
|
benchmark:
|
|
name: Collect benchmark data
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- 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 | xargs rm -rf
|
|
find -type d -name rustpython | xargs rm -rf
|
|
find -mindepth 2 -maxdepth 2 -name violin.svg | xargs rm -rf
|
|
find -type f -not -name violin.svg | xargs rm -rf
|
|
for file in $(find -type f -name violin.svg); do mv $file $(echo $file | sed -E "s_\./([^/]+)/([^/]+)/violin\.svg_./\1/\2.svg_"); done
|
|
find -mindepth 2 -maxdepth 2 -type d | xargs rm -rf
|
|
cd ..
|
|
mv reports/* .
|
|
rmdir reports
|
|
- name: upload benchmark data to the website
|
|
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
|
|
rm -rf ./assets/criterion
|
|
cp -r ../target/criterion ./assets/criterion
|
|
git add ./assets/criterion
|
|
git -c user.name="Github Actions" -c user.email="actions@github.com" commit -m "Update benchmark results"
|
|
git push
|