|
| 1 | +name: CI / Validation |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: [main] |
| 6 | + |
| 7 | +jobs: |
| 8 | + test: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + |
| 11 | + steps: |
| 12 | + - name: Checkout code |
| 13 | + uses: actions/checkout@v4 |
| 14 | + |
| 15 | + - name: Install Rust |
| 16 | + uses: dtolnay/rust-toolchain@stable |
| 17 | + with: |
| 18 | + toolchain: stable |
| 19 | + |
| 20 | + - name: Install Node.js |
| 21 | + uses: actions/setup-node@v4 |
| 22 | + with: |
| 23 | + node-version: "20" |
| 24 | + cache: "npm" |
| 25 | + |
| 26 | + - name: Cache Rust dependencies |
| 27 | + uses: actions/cache@v4 |
| 28 | + with: |
| 29 | + path: | |
| 30 | + ~/.cargo/registry |
| 31 | + ~/.cargo/git |
| 32 | + contracts/target |
| 33 | + key: ${{ runner.os }}-cargo-${{ hashFiles('contracts/**/Cargo.lock') }} |
| 34 | + restore-keys: | |
| 35 | + ${{ runner.os }}-cargo- |
| 36 | +
|
| 37 | + - name: Install backend dependencies |
| 38 | + run: npm install |
| 39 | + working-directory: ./backend |
| 40 | + |
| 41 | + - name: Install frontend dependencies |
| 42 | + run: npm install |
| 43 | + working-directory: ./frontend |
| 44 | + |
| 45 | + - name: Run linting (backend) |
| 46 | + run: npm run lint --if-present |
| 47 | + working-directory: ./backend |
| 48 | + continue-on-error: false |
| 49 | + |
| 50 | + - name: Run linting (frontend) |
| 51 | + run: npm run lint --if-present |
| 52 | + working-directory: ./frontend |
| 53 | + continue-on-error: false |
| 54 | + |
| 55 | + - name: Run Rust tests |
| 56 | + run: cargo test |
| 57 | + working-directory: ./contracts |
| 58 | + continue-on-error: false |
| 59 | + |
| 60 | + - name: Run backend tests |
| 61 | + run: npm test |
| 62 | + working-directory: ./backend |
| 63 | + continue-on-error: false |
| 64 | + |
| 65 | + - name: Run frontend tests |
| 66 | + run: npm test |
| 67 | + working-directory: ./frontend |
| 68 | + continue-on-error: false |
0 commit comments