|
| 1 | +name: Obscura Helper Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - 4.x |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - '**' |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | +env: |
| 16 | + CI: true |
| 17 | + FORCE_COLOR: 1 |
| 18 | + OBSCURA_VERSION: v0.1.11 |
| 19 | + OBSCURA_SHA256: c9343428c9692c49e837487f1d0a8f308b280dd854981c5a06f2aece0048230e |
| 20 | + |
| 21 | +jobs: |
| 22 | + build: |
| 23 | + runs-on: ubuntu-22.04 |
| 24 | + timeout-minutes: 15 |
| 25 | + |
| 26 | + strategy: |
| 27 | + matrix: |
| 28 | + node-version: [20.x] |
| 29 | + |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v6 |
| 32 | + - name: Use Node.js ${{ matrix.node-version }} |
| 33 | + uses: actions/setup-node@v6 |
| 34 | + with: |
| 35 | + node-version: ${{ matrix.node-version }} |
| 36 | + - uses: shivammathur/setup-php@v2 |
| 37 | + with: |
| 38 | + php-version: 8.0 |
| 39 | + - name: npm install |
| 40 | + run: npm i --force |
| 41 | + - name: Cache Obscura binary |
| 42 | + uses: actions/cache@v4 |
| 43 | + with: |
| 44 | + path: ~/obscura-bin |
| 45 | + key: obscura-${{ env.OBSCURA_VERSION }}-x86_64-linux |
| 46 | + - name: Download Obscura |
| 47 | + run: | |
| 48 | + if [ ! -f ~/obscura-bin/obscura ]; then |
| 49 | + mkdir -p ~/obscura-bin |
| 50 | + curl -sL -o /tmp/obscura.tar.gz https://github.com/h4ckf0r0day/obscura/releases/download/${OBSCURA_VERSION}/obscura-x86_64-linux.tar.gz |
| 51 | + echo "${OBSCURA_SHA256} /tmp/obscura.tar.gz" | sha256sum -c - |
| 52 | + tar xzf /tmp/obscura.tar.gz -C ~/obscura-bin |
| 53 | + fi |
| 54 | + ~/obscura-bin/obscura --version |
| 55 | + - name: start test server and obscura |
| 56 | + run: | |
| 57 | + php -S 127.0.0.1:8000 -t test/data/app & |
| 58 | + ~/obscura-bin/obscura serve --port 9222 --allow-private-network & |
| 59 | + sleep 2 |
| 60 | + curl -sf http://127.0.0.1:9222/json/version |
| 61 | + curl -sf http://127.0.0.1:8000/info > /dev/null |
| 62 | + - name: run obscura helper tests |
| 63 | + run: npm run test:unit:webbapi:obscura |
0 commit comments