Dependency updates. GitHub action improvement. #17
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: Format, Clippy and Tests | |
| on: | |
| push: | |
| branches: | |
| - development | |
| - main | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| concurrency: | |
| group: ${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| format-clippy-test: | |
| name: Format, Clippy and Tests | |
| runs-on: ubuntu-20.04 | |
| steps: | |
| - uses: ikalnytskyi/action-setup-postgres@v7 | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Make the chainspec init script executable | |
| run: chmod +x ./_chainspecs/init.sh | |
| - name: Fetch chainspecs | |
| run: ./_chainspecs/init.sh | |
| - name: Toolchain | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: nightly #-2022-11-15 # toolchain | |
| components: clippy, rustfmt | |
| override: true | |
| - run: rustup update | |
| - run: rustup update nightly #-2022-11-15 # toolchain | |
| - run: rustup default nightly #-2022-11-15 # toolchain | |
| - run: rustup target add wasm32-unknown-unknown --toolchain nightly #-2022-11-15 # toolchain | |
| - run: rustup default stable | |
| - name: Install SQLx | |
| run: cargo install sqlx-cli --no-default-features --features native-tls,postgres | |
| - name: Make the DB reset script executable | |
| run: chmod +x ./_scripts/reset-crystal-test-db.sh | |
| - name: Reset test DB | |
| run: ./_scripts/reset-crystal-test-db.sh | |
| - name: Format | |
| uses: actions-rs/cargo@v1 | |
| with: | |
| command: fmt | |
| args: --all -- --check | |
| - name: Clippy | |
| uses: actions-rs/cargo@v1 | |
| with: | |
| toolchain: nightly #-2022-11-15 # toolchain | |
| command: clippy | |
| args: --all-targets -- -D warnings -W clippy::cognitive_complexity | |
| - name: Test | |
| uses: actions-rs/cargo@v1 | |
| env: | |
| SUBVT_ENV: 'test' | |
| with: | |
| command: test | |
| args: -- --test-threads=1 |