58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
name: CI (fast)
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
test:
|
|
if: github.repository == 'dreamwidth/dreamwidth'
|
|
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: ghcr.io/dreamwidth/devcontainer:latest
|
|
|
|
env:
|
|
LJHOME: ${{ github.workspace }}
|
|
PERL5LIB: /opt/dreamwidth-extlib/lib/perl5
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install CPAN dependencies
|
|
run: cpm install -v --show-build-log-on-failure --no-color --resolver metadb -L /opt/dreamwidth-extlib/ - < doc/dependencies-cpanm
|
|
|
|
- name: Setup environment
|
|
run: |
|
|
# Config symlink (needed for Perl modules to load site config)
|
|
mkdir -p $LJHOME/ext/local
|
|
ln -ns $LJHOME/.devcontainer/config/etc/dw-etc $LJHOME/ext/local/etc
|
|
|
|
# Symlink pre-built static assets from the image
|
|
mkdir -p $LJHOME/build
|
|
ln -snf /opt/dreamwidth-static $LJHOME/build/static
|
|
|
|
# Start MySQL and initialize test databases
|
|
service mysql start
|
|
t/bin/initialize-db
|
|
|
|
- name: Code formatting (t/02-tidy.t)
|
|
run: prove -v t/02-tidy.t
|
|
|
|
- name: Module compilation (t/00-compile.t)
|
|
run: prove -v t/00-compile.t
|
|
|
|
- name: Plack integration tests
|
|
run: prove t/plack-*.t
|
|
|
|
- name: Text cleaner tests
|
|
run: prove t/cleaner-*.t
|
|
|
|
- name: Routing tests
|
|
run: prove t/routing-*.t
|
|
|
|
- name: Rate limiting tests
|
|
run: prove -v t/rate-limit.t
|