Sandbox CSS-only build dependencies #2619
Workflow file for this run
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: Tests | |
| on: [push, pull_request] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| container: | |
| image: ghcr.io/weasyl/ci-base-image@sha256:8ee6114de81bdc98ec97e097e8fda2d00c117af88a7497f77489bc4fb1624046 | |
| options: --user 1001 --tmpfs /magick-tmp:mode=700,uid=1001 | |
| services: | |
| weasyl-database: | |
| image: postgres:9.6 | |
| env: | |
| POSTGRES_HOST_AUTH_METHOD: trust | |
| POSTGRES_USER: weasyl | |
| POSTGRES_DB: weasyl_test | |
| # probably ready by the time the tests run anyway; no need to add latency | |
| #options: >- | |
| # --health-cmd pg_isready | |
| # --health-interval 10s | |
| # --health-timeout 5s | |
| # --health-retries 5 | |
| weasyl-memcached: | |
| image: memcached:1.5-alpine | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Cache Deno dependencies | |
| uses: actions/cache@v5 | |
| with: | |
| path: /deno-dir/ | |
| key: cache-${{ runner.os }}-deno-${{ hashFiles('deno.lock') }} | |
| restore-keys: | | |
| cache-${{ runner.os }}-deno- | |
| - name: Cache Poetry | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/pip | |
| key: cache-${{ runner.os }}-pip-${{ hashFiles('poetry-requirements.txt') }} | |
| restore-keys: | | |
| cache-${{ runner.os }}-pip- | |
| - name: Cache Python dependencies | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/pypoetry | |
| key: cache-${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} | |
| restore-keys: | | |
| cache-${{ runner.os }}-poetry- | |
| - name: Create Poetry virtualenv | |
| run: python3 -m venv --system-site-packages --without-pip .poetry-venv | |
| - name: Install Poetry | |
| run: | | |
| .poetry-venv/bin/python3 -m pip install --require-hashes --only-binary :all: --no-deps -r poetry-requirements.txt | |
| - name: Create virtualenv | |
| run: python3 -m venv --system-site-packages --without-pip .venv | |
| - name: Install Deno dependencies | |
| run: | | |
| ( | |
| export LD_LIBRARY_PATH=/opt/deno/lib | |
| deno install --frozen --vendor=false && deno ci | |
| ) \ | |
| && sha256sum -c <<'SHA256' \ | |
| && sed -i -f - node_modules/autoprefixer/lib/supports.js <<'SED' | |
| 68c4208ae3e1aad176f61fe7ba27d351d8b8f931dad1b3938702c3bb80106d24 node_modules/autoprefixer/lib/supports.js | |
| SHA256 | |
| 214a\ | |
| , this.all.browsers.browserslistOpts | |
| SED | |
| - name: Install Python dependencies | |
| run: .poetry-venv/bin/poetry install | |
| - name: Configure Weasyl | |
| run: | | |
| cp ci/site.config.txt config/ | |
| cp config/weasyl-staff.example.py config/weasyl-staff.py | |
| cat imagemagick-policy.xml > /usr/etc/ImageMagick-6/policy.xml | |
| printf %.8s "$GITHUB_SHA" > version.txt | |
| - name: Build assets | |
| run: | | |
| LD_LIBRARY_PATH=/opt/deno/lib \ | |
| deno run \ | |
| --cached-only \ | |
| --frozen \ | |
| --allow-env \ | |
| --allow-read \ | |
| --allow-write \ | |
| --allow-run \ | |
| build.ts \ | |
| --assets=./assets/ \ | |
| --output=./build/ | |
| - name: Test libweasyl | |
| env: | |
| WEASYL_TEST_SQLALCHEMY_URL: postgresql+psycopg2://weasyl@weasyl-database/weasyl_test | |
| run: .venv/bin/python -m pytest libweasyl.test libweasyl.models.test | |
| - name: Test weasyl | |
| env: | |
| WEASYL_APP_ROOT: . | |
| WEASYL_STORAGE_ROOT: testing | |
| run: .venv/bin/python -m pytest weasyl.test |