github-action-test.yml 3.66 KB
Newer Older
Francesc Guasch's avatar
Francesc Guasch committed
1
2
3
4
5
6
7
name: PR Workflow
on: pull_request
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
Francesc Guasch's avatar
Francesc Guasch committed
8
9
10
11
12
13
14
15
16
17
      - name: tmpfs run user
        run: sudo mkdir -p /run/user/$(id -u) ; sudo chown $(id -u) /run/user/$(id -u)
      - uses: mirromutth/mysql-action@v1.1
        with:
          character set server: 'utf8' # Optional, default value is 'utf8mb4'. The '--character-set-server' option for mysqld
          collation server: 'utf8_general_ci' # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld
          mysql database: 'ravada' # Optional, default value is "test". The specified database which will be create
          mysql root password: root
          mysql user: 'rvd_user' # Required if "mysql root password" is empty, default is empty. The superuser for the specified database. Can use secrets, too
          mysql password: Pword12345*
Francesc Guasch's avatar
Francesc Guasch committed
18
19
      - name: Update packages
        run: sudo apt update
Francesc Guasch's avatar
Francesc Guasch committed
20
      - name: Install auth packages
Francesc Guasch's avatar
Francesc Guasch committed
21
        run: |
Francesc Guasch's avatar
Francesc Guasch committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
          sudo apt-get -y install perl libtest-perl-critic-perl liblist-moreutils-perl libyaml-perl libipc-run3-perl libmojolicious-perl libmojolicious-plugin-i18n-perl libxml-libxml-perl libdbix-connector-perl libmoose-perl libproc-pid-file-perl libimage-magick-perl libdatetime-perl libdatetime-format-dateparse-perl libjson-xs-perl libauthen-passphrase-perl libpbkdf2-tiny-perl libfile-rsync-perl libmoosex-types-netaddr-ip-perl libnet-dns-perl libnet-openssh-perl libio-interface-perl libsys-virt-perl libdbd-sqlite3-perl liblocale-maketext-lexicon-perl qemu-utils make cpanminus libnet-ldap-perl
      - name: Install LDAP server
        run: sudo apt-get install 389-ds-base
      - name: Configure LDAP server
        run: sudo dscreate from-file t/etc/ds389.conf
      - name: Install iptables
        run: sudo apt install iptables iptstate
      - name: Create ravada.conf
        run: sudo touch /etc/ravada.conf ; sudo chown $(id -u) /etc/ravada.conf
      - name: Install ravada conf
        run: cat etc/ravada.conf t/etc/ravada_ldap_basic.conf t/etc/ravada.conf | sed -e 's/localhost/127.0.0.1/' | grep -v -- "---" > /etc/ravada.conf
      - name: show ravada.conf
        run: cat /etc/ravada.conf
      - name: Install mysql perl
        run: sudo apt install libdbd-mysql-perl libhtml-lint-perl
      - name: create mysql user
        run: sudo mysql -u root --password=root --protocol=tcp -h localhost -e "create user 'rvd_user'@'%' IDENTIFIED WITH mysql_native_password BY 'Pword12345*'"
      - name: allow mysql user
        run: sudo mysql -u root --password=root --protocol=tcp -h localhost -e "grant all on ravada.* to 'rvd_user'@'%'"
      - name: Test mojo grants
        run: prove -l t/mojo/30_grants.t
Francesc Guasch's avatar
Francesc Guasch committed
43
      - name: Test critic
Francesc Guasch's avatar
Francesc Guasch committed
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
        run: prove -l t/critic.t
      - name: Install localization and doc packages
        run: sudo apt install gettext libtest-pod-coverage-perl
      - name: Test localization
        run: prove -l t/90_pos.t
      - name: Install cpanm
        run: sudo cpanm  --force Authen::ModAuthPubTkt
      - name: Test libs
        run: prove -l t/00_libs.t
      - name: Test pod coverage
        run: prove -l t/pod_coverage.t
      - name: Install test packages
        run: sudo apt install libsys-statistics-linux-perl libtest-moose-more-perl
      - name: Test Auth
        run: prove -lr t/40_auth_sql.t t/60_user_sql.t t/65_user_ldap.t t/66_group_ldap.t t/front/60_ldap.t t/front/70_ldap_access.t t/front/80_access.t t/user
Francesc Guasch's avatar
Francesc Guasch committed
59
60
      - name: Test Templates
        run: prove -lr t/17_templates.t
Francesc Guasch's avatar
Francesc Guasch committed
61
      - name: Test mock VM
Francesc Guasch's avatar
Francesc Guasch committed
62
        run: prove -lr t/vm/60_new_args.t t/30_request.t
63
64
      - name: Test create from ISO
        run: prove -lr t/request/25_create_from_iso.t