I've my anchor project build with serum's anchor framework.
I want to set up github action, So that whenever a new pull request is raised or any commit is made on the main branch, I can be sure that no code has been broken and flag any such pull request.
Here is what I've tried. But it needs around 18 to 20 minutes to run and still unsuccessful.
name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install AVM
run: cargo install --git https://github.com/project-serum/anchor avm --force
- name: Install Anchor
run: avm install 0.24.2 && avm use 0.24.2
- name: Build
run: anchor build
- name: Run tests
run: anchor test
The initial approach was not efficient
cons:
When dug deep found out that found out that
serum
releases docker images for this purpose only. So I modified my action file toIt brought down the run time from 18 minutes to 3 minutes approximately.
References: