Bancor V3 #5409
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
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: [main] | |
name: CI | |
jobs: | |
clippy: | |
name: "clippy" | |
if: github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@clippy | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
key: "clippy" | |
- run: git config --global url."https://x-access-token:${{ secrets.CI }}@github.com/".insteadOf "https://github.com/" | |
shell: bash | |
- run: git config --global url."https://${{ secrets.CI }}@github.com/".insteadOf "git@github.com:" | |
shell: bash | |
- name: "clippy all" | |
run: cargo clippy --workspace --lib --examples --tests --benches --all-features | |
env: | |
RUSTFLAGS: -D warnings | |
build: | |
name: "build and fmt" | |
if: github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: "buildfmt" | |
cache-on-failure: true | |
# allow for downloads | |
- run: git config --global url."https://x-access-token:${{ secrets.CI }}@github.com/".insteadOf "https://github.com/" | |
shell: bash | |
- run: git config --global url."https://${{ secrets.CI }}@github.com/".insteadOf "git@github.com:" | |
shell: bash | |
- name: "build nightly" | |
run: cargo build --workspace --all-features | |
env: | |
RUSTFLAGS: -D warnings | |
- name: "cargo fmt" | |
run: cargo fmt --all --check | |
test: | |
runs-on: ubuntu-latest | |
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && github.event.pull_request.draft == false | |
needs: [clippy, build] | |
strategy: | |
fail-fast: false | |
matrix: | |
features: ["sorella-server"] | |
steps: | |
- name: Get branch names. | |
id: branch-names | |
uses: tj-actions/branch-names@v8 | |
- name: Init ssh config | |
run: | | |
mkdir ~/.ssh/ | |
echo "${{ secrets.BASTION_SSH }}" > ~/.ssh/bastion | |
chmod 600 ~/.ssh/bastion | |
echo "${{ secrets.BRONTES_SSH }}" > ~/.ssh/brontes_server | |
chmod 600 ~/.ssh/brontes_server | |
echo "${{ secrets.SSH_CONFIG }}" > ~/.ssh/config | |
- name: cargo test | |
run: ssh brontes_server -tt "bash --login -c 'source ~/.bashrc && mkdir -p ${{ steps.branch-names.outputs.current_branch }}-test-${{ matrix.features }} && cd ${{ steps.branch-names.outputs.current_branch }}-test-${{ matrix.features }} && git clone https://github.com/SorellaLabs/brontes.git && cd brontes && git pull && git checkout ${{ steps.branch-names.outputs.current_branch }} && ./scripts/run-tests.sh ${{ steps.branch-names.outputs.current_branch }} ${{ steps.branch-names.outputs.current_branch }}-test-${{ matrix.features }} test ${{ matrix.features }}'" | |
it-test: | |
runs-on: ubuntu-latest | |
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && github.event.pull_request.draft == false | |
needs: [clippy, build] | |
strategy: | |
fail-fast: false | |
matrix: | |
features: ["sorella-server"] | |
steps: | |
- name: Get branch names. | |
id: branch-names | |
uses: tj-actions/branch-names@v8 | |
- name: Init ssh config | |
run: | | |
mkdir ~/.ssh/ | |
echo "${{ secrets.BASTION_SSH }}" > ~/.ssh/bastion | |
chmod 600 ~/.ssh/bastion | |
echo "${{ secrets.BRONTES_SSH }}" > ~/.ssh/brontes_server | |
chmod 600 ~/.ssh/brontes_server | |
echo "${{ secrets.SSH_CONFIG }}" > ~/.ssh/config | |
- name: cargo it test | |
run: ssh brontes_server -tt "bash --login -c 'source ~/.bashrc && mkdir -p ${{ steps.branch-names.outputs.current_branch }}-it-${{ matrix.features }} && cd ${{ steps.branch-names.outputs.current_branch }}-it-${{ matrix.features }} && git clone https://github.com/SorellaLabs/brontes.git && cd brontes && git pull && git checkout ${{ steps.branch-names.outputs.current_branch }} && ./scripts/run-tests.sh ${{ steps.branch-names.outputs.current_branch }} ${{ steps.branch-names.outputs.current_branch }}-it-${{ matrix.features }} it ${{ matrix.features }}'" | |
bench: | |
strategy: | |
fail-fast: false | |
matrix: | |
features: ["sorella-server"] | |
runs-on: ubuntu-latest | |
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && github.event.pull_request.draft == false | |
needs: [clippy, build] | |
steps: | |
- name: Get branch names. | |
id: branch-names | |
uses: tj-actions/branch-names@v8 | |
- name: Init ssh config | |
run: | | |
mkdir ~/.ssh/ | |
echo "${{ secrets.BASTION_SSH }}" > ~/.ssh/bastion | |
chmod 600 ~/.ssh/bastion | |
echo "${{ secrets.BRONTES_SSH }}" > ~/.ssh/brontes_server | |
chmod 600 ~/.ssh/brontes_server | |
echo "${{ secrets.SSH_CONFIG }}" > ~/.ssh/config | |
- name: cargo bench | |
run: ssh brontes_server -tt "bash --login -c 'source ~/.bashrc && mkdir -p ${{ steps.branch-names.outputs.current_branch }}-bench-${{ matrix.features }} && cd ${{ steps.branch-names.outputs.current_branch }}-bench-${{ matrix.features }} && git clone https://github.com/SorellaLabs/brontes.git && cd brontes && git pull && git checkout ${{ steps.branch-names.outputs.current_branch }} && ./scripts/run-tests.sh ${{ steps.branch-names.outputs.current_branch }} ${{ steps.branch-names.outputs.current_branch }}-bench-${{ matrix.features }} bench ${{ matrix.features }} '" | |