|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [stage] |
| 6 | + pull_request: |
| 7 | + branches: [stage] |
| 8 | + |
| 9 | +env: |
| 10 | + API_ENDPOINT_SERVER: "http://localhost:1443" |
| 11 | + API_ENDPOINT_TRUSTAUTH_TO_SERVER: "https://localhost:1444" |
| 12 | + API_ENDPOINT_TRUSTAUTH: "http://localhost:2443" |
| 13 | + API_ENDPOINT_SERVER_TO_TRUSTAUTH: "https://localhost:2444" |
| 14 | + |
| 15 | +jobs: |
| 16 | + frontend: |
| 17 | + name: Frontend tests |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + |
| 22 | + - uses: dtolnay/rust-toolchain@stable |
| 23 | + |
| 24 | + - uses: Swatinem/rust-cache@v2 |
| 25 | + |
| 26 | + - name: Generate mTLS certificates |
| 27 | + working-directory: mtls |
| 28 | + run: bash mkcerts.sh dev |
| 29 | + |
| 30 | + - name: Build backend binaries |
| 31 | + run: cargo build --bin rustsystem-server --bin rustsystem-trustauth |
| 32 | + |
| 33 | + - name: Start backend services |
| 34 | + run: | |
| 35 | + ./target/debug/rustsystem-server & |
| 36 | + ./target/debug/rustsystem-trustauth & |
| 37 | +
|
| 38 | + - name: Wait for services to be ready |
| 39 | + run: | |
| 40 | + until curl -sf http://localhost:1443/ > /dev/null 2>&1; do sleep 1; done |
| 41 | + until curl -sf http://localhost:2443/ > /dev/null 2>&1; do sleep 1; done |
| 42 | +
|
| 43 | + - uses: pnpm/action-setup@v4 |
| 44 | + with: |
| 45 | + version: latest |
| 46 | + |
| 47 | + - uses: actions/setup-node@v4 |
| 48 | + with: |
| 49 | + node-version: 22 |
| 50 | + cache: pnpm |
| 51 | + cache-dependency-path: frontend/pnpm-lock.yaml |
| 52 | + |
| 53 | + - name: Install dependencies |
| 54 | + working-directory: frontend |
| 55 | + run: pnpm install --frozen-lockfile |
| 56 | + |
| 57 | + - name: Run tests |
| 58 | + working-directory: frontend |
| 59 | + run: pnpm test |
| 60 | + |
| 61 | + backend: |
| 62 | + name: Backend tests |
| 63 | + runs-on: ubuntu-latest |
| 64 | + steps: |
| 65 | + - uses: actions/checkout@v4 |
| 66 | + |
| 67 | + - name: Generate mTLS certificates |
| 68 | + working-directory: mtls |
| 69 | + run: bash mkcerts.sh dev |
| 70 | + |
| 71 | + - uses: dtolnay/rust-toolchain@stable |
| 72 | + |
| 73 | + - uses: Swatinem/rust-cache@v2 |
| 74 | + |
| 75 | + - name: Run tests |
| 76 | + run: cargo test |
0 commit comments