CHG port proxy to rust #100
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: Anubis Pull Request CD/CI | |
on: | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
# Test Stage. | |
test-api: | |
name: Test api | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
working-directory: api | |
strategy: | |
matrix: | |
python-version: [ '3.10' ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v3 | |
id: cache-venv # name for referring later | |
with: | |
path: | | |
**/venv | |
key: ${{ runner.os }}-venv-${{ hashFiles('**/api/requirements/dev.txt') }} | |
- name: Install dependencies | |
run: | | |
set -ex | |
python -m venv venv | |
if [ -f requirements/dev.txt ]; then ./venv/bin/pip install -r requirements/dev.txt; fi | |
if: steps.cache-venv.outputs.cache-hit != 'true' | |
- name: Background API | |
run: | | |
set -ex | |
docker run -itd -p 6379:6379 redis redis-server --requirepass anubis | |
env MINDEBUG=1 MIGRATE=1 ./venv/bin/python3 dev.py & | |
- name: Test with pytest | |
run: | | |
./tests/mintest.sh | |
- name: Teardown | |
run: | | |
killall -9 python3 | |
test-web: | |
name: test web | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
working-directory: web | |
strategy: | |
matrix: | |
node-version: [ 16.x ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- uses: actions/cache@v3 | |
id: yarn-cache | |
with: | |
path: | | |
**/node_modules | |
**/.eslintcache | |
${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- run: yarn install --frozen-lockfile | |
- run: env DISABLE_ESLINT_PLUGIN=true yarn run build |