Updates todo #887
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: Proxy tests | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
paths: | |
- "config/openresty/**" | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- uses: leafo/gh-actions-openresty@v1 | |
with: | |
openrestyVersion: "1.21.4.2" | |
configureFlags: "--with-pcre-jit --with-ipv6 --with-http_v2_module" | |
- uses: leafo/gh-actions-luarocks@v4 | |
with: | |
withLuaPath: "/usr/local/openresty/luajit/" | |
- name: install auto-ssl | |
run: | | |
which luarocks | |
sudo /home/runner/work/Blot/Blot/.luarocks/bin/luarocks install lua-resty-auto-ssl | |
sudo /home/runner/work/Blot/Blot/.luarocks/bin/luarocks list | |
luarocks show lua-resty-auto-ssl | |
- name: Set up Redis | |
uses: shogo82148/actions-setup-redis@v1 | |
with: | |
redis-version: 6.2.6 | |
- name: Set up Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16.14.0 | |
- name: Load dependencies | |
uses: actions/cache@v2 | |
id: cache-node-dependencies | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }} | |
- name: Install Dependencies | |
if: steps.cache-node-dependencies.outputs.cache-hit != 'true' | |
env: | |
PUPETEER_PRODUCT: firefox | |
run: npm ci | |
- name: build openresty config | |
env: | |
NODE_PATH: /home/runner/work/Blot/Blot/app | |
NODE_SERVER_IP: 127.0.0.1 | |
LUA_PACKAGE_PATH: /home/runner/work/Blot/Blot/.luarocks/share/lua/5.1/?.lua;/home/runner/work/Blot/Blot/config/openresty/conf/?.lua | |
REDIS_IP: 127.0.0.1 | |
OPENRESTY_USER: runner | |
DISABLE_HTTP2: true | |
OPENRESTY_CACHE_DIRECTORY: /home/runner/work/Blot/Blot/config/openresty/data/cache | |
OPENRESTY_CONFIG_DIRECTORY: /home/runner/work/Blot/Blot/config/openresty/data | |
SSL_CERTIFICATE: /home/runner/work/Blot/Blot/config/openresty/data/selfsigned.crt | |
SSL_CERTIFICATE_KEY: /home/runner/work/Blot/Blot/config/openresty/data/selfsigned.key | |
run: | | |
node config/openresty/build-config.js | |
cat config/openresty/data/openresty.conf | |
# run this after building config since building config will overwrite the data directory | |
- name: generate self-signed SSL certs | |
run: | | |
mkdir -p /home/runner/work/Blot/Blot/config/openresty/data | |
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /home/runner/work/Blot/Blot/config/openresty/data/selfsigned.key -out /home/runner/work/Blot/Blot/config/openresty/data/selfsigned.crt -subj "/C=US/ST=Oregon/L=Portland/O=Company Name/OU=Org/CN=localhost" | |
- name: run openresty | |
run: | | |
sudo mkdir -p /var/instance-ssd/logs | |
sudo /usr/local/openresty/bin/openresty -c /home/runner/work/Blot/Blot/config/openresty/data/openresty.conf | |
- name: check openresty is running on port 80 | |
run: | | |
curl localhost:80 | |
- name: run openresty tests | |
env: | |
NODE_PATH: /home/runner/work/Blot/Blot/app | |
BLOT_OPENRESTY_TEST_USER: runner | |
BLOT_OPENRESTY_TEST_GROUP: runner | |
run: | | |
node tests config/openresty |