|
1 |
| -name: Message Buffer Check |
| 1 | +name: Test Message Buffer |
| 2 | + |
2 | 3 | on:
|
3 | 4 | pull_request:
|
4 | 5 | paths:
|
|
7 | 8 | push:
|
8 | 9 | branches:
|
9 | 10 | - main
|
| 11 | + |
| 12 | +env: |
| 13 | + CARGO_TERM_COLOR: always |
| 14 | + |
10 | 15 | jobs:
|
11 |
| - abi-check: |
12 |
| - name: Check Message Buffer formatting & IDL files |
| 16 | + build: |
13 | 17 | runs-on: ubuntu-latest
|
14 | 18 | defaults:
|
15 | 19 | run:
|
16 | 20 | working-directory: pythnet/message_buffer
|
17 | 21 | steps:
|
18 |
| - - name: Checkout sources |
19 |
| - uses: actions/checkout@v3 |
| 22 | + - uses: actions/checkout@v2 |
20 | 23 | - uses: Swatinem/rust-cache@v2
|
21 | 24 | with:
|
22 | 25 | workspaces: "pythnet/message_buffer -> target"
|
23 | 26 | - uses: actions-rs/toolchain@v1
|
24 | 27 | with:
|
25 |
| - profile: minimal |
26 | 28 | toolchain: 1.66.1
|
27 | 29 | components: rustfmt, clippy
|
28 | 30 | - name: Install Solana
|
29 | 31 | run: |
|
30 |
| - wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb |
31 |
| - sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb |
32 |
| - sh -c "$(curl -sSfL https://release.anza.xyz/v1.17.34/install)" |
| 32 | + sh -c "$(curl -sSfL https://release.solana.com/v1.14.17/install)" |
33 | 33 | echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
|
34 |
| - - name: Install Anchor |
35 |
| - run: | |
36 |
| - cargo install --git https://github.com/coral-xyz/anchor --tag v0.27.0 anchor-cli --locked |
37 |
| - - name: Install g++ 12 |
38 |
| - run: | |
39 |
| - sudo apt-get install g++-12 |
40 |
| - echo "CXX=/usr/bin/g++-12" >> "${GITHUB_ENV}" |
41 |
| - - uses: actions/setup-node@v4 |
42 |
| - with: |
43 |
| - node-version-file: "package.json" |
44 |
| - # Libusb is a build requirement for the node-hid package and so pnpm |
45 |
| - # install will fail if this isn't in the build environment and if a |
46 |
| - # precompiled binary isn't found. |
47 |
| - - name: Install libusb |
48 |
| - run: sudo apt-get update && sudo apt-get install -y libusb-1.0-0-dev libudev-dev |
49 |
| - - uses: pnpm/action-setup@v4 |
50 |
| - name: Install pnpm |
51 |
| - with: |
52 |
| - run_install: true |
53 |
| - - name: Build and generate IDLs |
54 |
| - run: anchor build |
55 |
| - - name: Copy anchor target files |
56 |
| - run: cp ./target/idl/message_buffer.json idl/ && cp ./target/types/message_buffer.ts idl/ |
57 |
| - - name: Fix formatting (to avoid pre-commit failures) |
58 |
| - run: pnpm turbo --filter message_buffer fix:format |
59 |
| - - name: Check IDL changes |
60 |
| - # Fails if the IDL files are not up to date. Please use anchor build to regenerate the IDL files for |
61 |
| - # the current version of the contract and update idl directory. |
62 |
| - run: git diff --exit-code idl/* |
63 |
| - if: success() || failure() |
64 |
| - - name: Cargo format |
| 34 | + - name: Format check |
65 | 35 | run: cargo fmt --all -- --check
|
66 | 36 | if: success() || failure()
|
67 |
| - - name: Cargo clippy |
| 37 | + - name: Clippy check |
68 | 38 | run: cargo clippy --tests -- --deny warnings
|
69 | 39 | if: success() || failure()
|
| 40 | + - name: Build |
| 41 | + run: cargo-build-bpf |
| 42 | + if: success() || failure() |
| 43 | + - name: Run tests |
| 44 | + run: cargo-test-bpf |
| 45 | + if: success() || failure() |
0 commit comments