impl IntoIterator for chain
#109
This file contains hidden or 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
| name: push ci | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| workflow_dispatch: | |
| concurrency: | |
| cancel-in-progress: true | |
| group: push-ci-${{ github.event.ref }} | |
| env: | |
| RUSTFLAGS: "-Cinstrument-coverage -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code" | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.runs-on }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| runs-on: | |
| - ubuntu-22.04 | |
| - ubuntu-24.04 | |
| - macos-14 | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: setup rust | |
| run: rustc --version | |
| - name: install wasm-bindgen-cli | |
| run: cargo install wasm-bindgen-cli | |
| env: | |
| # for CI use, optimise more for compilation speed rather than runtime speed | |
| # could probably be made more optimal | |
| RUSTFLAGS: -Clto=off -Copt-level=1 -Ccodegen-units=1024 -Cpanic=unwind | |
| - name: build | |
| run: cargo build --verbose | |
| - name: test | |
| run: cargo test --verbose | |
| env: | |
| CARGO_INCREMENTAL: "0" | |
| LLVM_PROFILE_FILE: "target/coverage/test-%m-%p.profraw" | |
| - name: fetch/run grcov | |
| run: | | |
| platform=$(uname) | |
| case $platform in | |
| Darwin) | |
| # macos-14 runners run on apple silicon, so aarch64 | |
| curl -Lo grcov.bz2 https://github.com/mozilla/grcov/releases/download/v0.8.19/grcov-aarch64-apple-darwin.tar.bz2 | |
| ;; | |
| Linux) | |
| curl -Lo grcov.bz2 https://github.com/mozilla/grcov/releases/download/v0.8.19/grcov-x86_64-unknown-linux-musl.tar.bz2 | |
| ;; | |
| *) | |
| echo weird | |
| exit 1 | |
| ;; | |
| esac | |
| tar xvf grcov.bz2 | |
| rm grcov.bz2 | |
| ./grcov . -s . -t lcov --binary-path ./target/debug/ --branch --ignore-not-existing -o ./target/coverage/tests.lcov | |
| - name: upload to codecov | |
| uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0 | |
| with: | |
| files: target/coverage/*.lcov | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| clippy: | |
| uses: ./.github/workflows/clippy.yml | |
| docs: | |
| needs: | |
| - test | |
| # TODO enable when existing warnings have been cleared | |
| # - clippy | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: setup rust | |
| run: rustc --version | |
| - name: install fish shell | |
| run: | | |
| sudo add-apt-repository -yn ppa:fish-shell/release-3 | |
| sudo apt-get update | |
| sudo apt-get install fish | |
| - name: generate docs | |
| shell: fish {0} | |
| run: | | |
| set -gx RUSTDOCFLAGS "--cfg docsrs --cfg kiwingay -Z unstable-options --enable-index-page --theme "(pwd)"/.cargo/rustdoc-custom-theme/meadow.css" | |
| set -gx KIWINGAY_DEPLOY_COMMIT_SHORT (string sub --length 8 $KIWINGAY_DEPLOY_COMMIT) | |
| cargo doc --verbose --no-deps --lib | |
| env: | |
| KIWINGAY_DEPLOY_COMMIT: ${{ github.sha }} | |
| - name: checkout gh-pages branch | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| path: gh-pages | |
| ref: gh-pages | |
| - name: deploy docs | |
| shell: fish {0} | |
| run: | | |
| rm -rf gh-pages/* | |
| mv gh-pages/.git gh-pages/git | |
| rm -rf gh-pages/.* | |
| mv gh-pages/git gh-pages/.git | |
| cp -R target/doc/* gh-pages | |
| cp -R target/doc/.* gh-pages | |
| cp .gitignore gh-pages/.gitignore | |
| touch gh-pages/.nojekyll | |
| echo wiwi.kiwin.gay > gh-pages/CNAME | |
| set COMMIT_MESSAGE "(automated) deploy from commit "(git rev-parse HEAD) | |
| cd gh-pages | |
| git config --global user.name "smol" | |
| git config --global user.email "107521333+a-tiny-kirin@users.noreply.github.com" | |
| echo https://meadowsys:${{ secrets.GHPAT }}@github.com > .git/credentials | |
| git config --global credential.helper "store --file=.git/credentials" | |
| git config --unset-all http.https://github.com/.extraheader # https://stackoverflow.com/a/69979203 | |
| git add -A | |
| git commit -m "$COMMIT_MESSAGE" --allow-empty | |
| git push |