bak #111
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: CI | |
| on: | |
| push: | |
| branches: | |
| - 'master' | |
| - 'develop_*' | |
| workflow_dispatch: | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| # Required permissions | |
| permissions: | |
| pull-requests: read | |
| # Set job outputs to values from filter step | |
| outputs: | |
| check_server: ${{ steps.filter.outputs.check_server }} | |
| check_js_client: ${{ steps.filter.outputs.check_js_client }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| check_server: | |
| - 'client/**' | |
| - 'server/**' | |
| - 'Cargo.lock' | |
| check_js_client: | |
| - 'jsclient/**' | |
| check_server: | |
| needs: changes | |
| if: ${{ needs.changes.outputs.check_server == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: run integration test | |
| # --show-output | |
| run: cargo test -p tests --test http_test -j 1 -- --test-threads 1 | |
| - name: run pebble | |
| run: ./run_pebble.sh | |
| working-directory: ./tests/bash/ | |
| - name: run acme integration test | |
| run: cargo test -p tests --test acme_test -j 1 -- --test-threads 1 | |
| - name: run spa-client test | |
| run: cargo test -p spa-client -j 1 -- --test-threads 1 | |
| - name: run spa-server test | |
| run: cargo test -p spa-server | |
| check_js_client: | |
| needs: changes | |
| if: ${{ needs.changes.outputs.check_js_client == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run spa-server docker | |
| run: | | |
| docker run -d -name=test -p 9000:9000 -p 8080:8080 -v ${{ github.workspace }}/jsclient/test/config.toml:/config/config.toml ghcr.io/fornetcode/spa-server:v2.4.0 | |
| docker ps | |
| docker logs --tail 50 test | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| cache-dependency-path: './jsclient/package-lock.json' | |
| - run: | | |
| cd ./example/js-app-example && npm ci && npm run build && \ | |
| cd ../../jsclient && npm ci && npm run build && npm test |