Remove Google Analytics and unused options #95
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: Test | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| hadolint: | |
| name: Test dockerfile syntax | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: hadolint/hadolint-action@v3.3.0 | |
| with: | |
| dockerfile: Dockerfile | |
| ignore: DL3025 | |
| node-test: | |
| name: Test npm package loads | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - run: npm ci | |
| - run: node -e "import('./src/index.js').then(m => { console.log('OK exports:', Object.keys(m)); process.exit(0); })" | |
| build: | |
| name: Build and test docker | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Find an open port | |
| run: | | |
| CLIENT_PORT=$(shuf -i 10000-19999 -n 1) | |
| echo "CLIENT_PORT=${CLIENT_PORT}" >> $GITHUB_ENV | |
| - name: Build docker image | |
| run: docker build --no-cache --tag sadeghhayeri/greentunnel:${GITHUB_RUN_ID} . | |
| - name: Run container | |
| run: | | |
| DOCKERCONTAINER=$(docker run -p 127.0.0.1:${CLIENT_PORT}:8000 -d sadeghhayeri/greentunnel:${GITHUB_RUN_ID}) | |
| sleep 5 | |
| echo "DOCKERCONTAINER=${DOCKERCONTAINER}" >> $GITHUB_ENV | |
| - name: Check container is running | |
| run: docker ps -f id=${DOCKERCONTAINER} | |
| - name: Check proxy responds | |
| run: curl -fIs --proxy http://127.0.0.1:${CLIENT_PORT} https://example.com | grep "200" | |
| - name: Stop and remove container | |
| run: docker stop ${DOCKERCONTAINER} && docker rm -fv ${DOCKERCONTAINER} |