Docs initial version (#60) #41
This file contains 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: Integration Tests | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
tests: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
tool-name: ['django', 'flask', 'fastapi', 'simple', 'simple_async', 'socketio'] | |
python-version: ['3.10', '3.11', '3.12', '3.13'] | |
env: | |
GOEXPERIMENT: cgocheck2 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.21' | |
cache: false | |
- name: Install Xcaddy | |
run: go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest | |
- name: Set up Python ${{ matrix.python-version }} | |
working-directory: tests/${{ matrix.tool-name }}/ | |
run: | | |
export DEBIAN_FRONTEND=noninteractive | |
sudo apt-get update -yyqq | |
sudo apt-get install -yyqq software-properties-common | |
sudo add-apt-repository -y ppa:deadsnakes/ppa | |
sudo apt-get install -yyqq python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv | |
sudo mv /usr/lib/x86_64-linux-gnu/pkgconfig/python-${{ matrix.python-version }}-embed.pc /usr/lib/x86_64-linux-gnu/pkgconfig/python3-embed.pc | |
python${{ matrix.python-version }} -m venv venv | |
source venv/bin/activate | |
pip install -r requirements.txt | |
- name: Build the server | |
working-directory: tests/${{ matrix.tool-name }}/ | |
run: CGO_ENABLED=1 xcaddy build --with github.com/mliezun/caddy-snake=../.. | |
- name: Run integration tests | |
working-directory: tests/${{ matrix.tool-name }}/ | |
run: | | |
./caddy run --config Caddyfile > caddy.log 2>&1 & | |
sleep 2 | |
source venv/bin/activate | |
python main_test.py |