1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- name: CI
-
- env:
- CARGO_TERM_COLOR: always
- REGISTRY: ghcr.io
-
- on:
- push:
- branches:
- - develop
- pull_request:
- types: [opened, reopened, edited, synchronize]
- branches:
- - develop
-
- jobs:
- fmt:
- name: fmt
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - name: Install Rust Toolchain
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- components: rustfmt
- - name: cargo fmt
- run: cargo +nightly fmt -- --check
- clippy:
- name: clippy
- needs: fmt
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - name: Install Rust Toolchain
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- components: clippy
- - name: cargo clippy
- run: cargo +nightly clippy --workspace --tests -- -D warnings
- tests:
- name: tests
- needs: [clippy, fmt]
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - name: Install Rust Toolchain
- uses: actions-rs/toolchain@v1
- with:
- toolchain: stable
- - name: Run tests for [common-api]
- run: cargo test --tests --all-features
- tests-web:
- name: tests-web
- needs: [clippy, fmt]
- runs-on: ubuntu-latest
- permissions:
- packages: read
- steps:
- - name: Log in to the Container registry
- uses: docker/login-action@v2.0.0
- with:
- registry: ${{ env.REGISTRY }}
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
- - name: Setup ssh access for a private repositories
- uses: webfactory/ssh-agent@v0.7.0
- with:
- ssh-private-key: |
- ${{ secrets.CLIENT_SSH_PRIVATE_KEY }}
- ${{ secrets.KEYEXCHANGE_SSH_PRIVATE_KEY }}
- ${{ secrets.SMARTCONTRACTS_SSH_PRIVATE_KEY }}
- - name: Clone key-exchange-server and deploy
- run: |
- docker pull ${{ env.REGISTRY }}/relayz-io/key-exchange:latest
- docker tag ${{ env.REGISTRY }}/relayz-io/key-exchange:latest key-exchange:latest
- git clone git@github.com:Relayz-io/key-exchange-server.git
- (cd key-exchange-server && docker compose up -d --no-build)
- - name: Clone near-smartcontracts and deploy
- run: |
- docker pull ${{ env.REGISTRY }}/relayz-io/sandbox:latest
- docker tag ${{ env.REGISTRY }}/relayz-io/sandbox:latest sandbox:latest
- docker pull ${{ env.REGISTRY }}/relayz-io/sandbox-artifact:latest
- docker tag ${{ env.REGISTRY }}/relayz-io/sandbox-artifact:latest sandbox-artifact:latest
- docker pull ${{ env.REGISTRY }}/relayz-io/contract-artifact:latest
- docker tag ${{ env.REGISTRY }}/relayz-io/contract-artifact:latest contract-artifact:latest
- git clone git@github.com:Relayz-io/near-smartcontracts.git
- (cd near-smartcontracts && docker compose -f docker-compose.yml -f docker-compose.tests.yml up -d --no-build)
- - uses: actions/checkout@v3
- - name: Run tests for [web]
- run: docker compose up --abort-on-container-exit
|