aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/schedules.yaml
blob: 5636c4cf90e92c1cc6bd1108eb068899ffb75e32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Scheduled

on:
  schedule:
    - cron: '0 0 * * *'  # every day at midnight
  workflow_dispatch:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  # run Sytest in different variations
  sytest:
    timeout-minutes: 60
    name: "Sytest (${{ matrix.label }})"
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        include:
          - label: SQLite

          - label: SQLite, full HTTP APIs
            api: full-http

          - label: PostgreSQL
            postgres: postgres

          - label: PostgreSQL, full HTTP APIs
            postgres: postgres
            api: full-http
    container:
      image: matrixdotorg/sytest-dendrite:latest
      volumes:
        - ${{ github.workspace }}:/src
        - /root/.cache/go-build:/github/home/.cache/go-build
        - /root/.cache/go-mod:/gopath/pkg/mod
      env:
        POSTGRES: ${{ matrix.postgres && 1}}
        API: ${{ matrix.api && 1 }}
        SYTEST_BRANCH: ${{ github.head_ref }}
        RACE_DETECTION: 1
    steps:
      - uses: actions/checkout@v3
      - uses: actions/cache@v3
        with:
          path: |
            ~/.cache/go-build
            /gopath/pkg/mod
          key: ${{ runner.os }}-go-sytest-${{ hashFiles('**/go.sum') }}
          restore-keys: |
            ${{ runner.os }}-go-sytest-
      - name: Run Sytest
        run: /bootstrap.sh dendrite
        working-directory: /src
      - name: Summarise results.tap
        if: ${{ always() }}
        run: /sytest/scripts/tap_to_gha.pl /logs/results.tap
      - name: Sytest List Maintenance
        if: ${{ always() }}
        run: /src/show-expected-fail-tests.sh /logs/results.tap /src/sytest-whitelist /src/sytest-blacklist
        continue-on-error: true # not fatal
      - name: Are We Synapse Yet?
        if: ${{ always() }}
        run: /src/are-we-synapse-yet.py /logs/results.tap -v
        continue-on-error: true # not fatal
      - name: Upload Sytest logs
        uses: actions/upload-artifact@v2
        if: ${{ always() }}
        with:
          name: Sytest Logs - ${{ job.status }} - (Dendrite, ${{ join(matrix.*, ', ') }})
          path: |
            /logs/results.tap
            /logs/**/*.log*
          
  element_web:
    timeout-minutes: 120
    runs-on: ubuntu-latest
    steps:
      - uses: tecolicom/actions-use-apt-tools@v1
        with:
          # Our test suite includes some screenshot tests with unusual diacritics, which are
          # supposed to be covered by STIXGeneral.
          tools: fonts-stix
      - uses: actions/checkout@v2
        with:
          repository: matrix-org/matrix-react-sdk
      - uses: actions/setup-node@v3
        with:
          cache: 'yarn'
      - name: Fetch layered build
        run: scripts/ci/layered.sh
      - name: Copy config
        run: cp element.io/develop/config.json config.json
        working-directory: ./element-web
      - name: Build
        env:
          CI_PACKAGE: true
        run: yarn build
        working-directory: ./element-web
      - name: Edit Test Config
        run: |
          sed -i '/HOMESERVER/c\        HOMESERVER: "dendrite",' cypress.config.ts
      - name: "Run cypress tests"
        uses: cypress-io/github-action@v4.1.1
        with:
          browser: chrome
          start: npx serve -p 8080 ./element-web/webapp
          wait-on: 'http://localhost:8080'
        env:
          PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
          TMPDIR: ${{ runner.temp }}