|
| 1 | +name: testing |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - 'forgejo*' |
| 8 | + - 'v*/forgejo*' |
| 9 | + |
| 10 | +jobs: |
| 11 | + lint-backend: |
| 12 | + runs-on: docker |
| 13 | + steps: |
| 14 | + - uses: https://code.forgejo.org/actions/checkout@v3 |
| 15 | + - uses: https://code.forgejo.org/actions/setup-go@v4 |
| 16 | + with: |
| 17 | + go-version: ">=1.20" |
| 18 | + check-latest: true |
| 19 | + - run: make deps-backend deps-tools |
| 20 | + - run: make lint-backend |
| 21 | + env: |
| 22 | + TAGS: bindata sqlite sqlite_unlock_notify |
| 23 | + checks-backend: |
| 24 | + runs-on: docker |
| 25 | + steps: |
| 26 | + - uses: https://code.forgejo.org/actions/checkout@v3 |
| 27 | + - uses: https://code.forgejo.org/actions/setup-go@v4 |
| 28 | + with: |
| 29 | + go-version: ">=1.20" |
| 30 | + check-latest: true |
| 31 | + - run: make deps-backend deps-tools |
| 32 | + - run: make --always-make checks-backend # ensure the "go-licenses" make target runs |
| 33 | + test-unit: |
| 34 | + runs-on: docker |
| 35 | + needs: [lint-backend, checks-backend] |
| 36 | + container: |
| 37 | + image: codeberg.org/forgejo/test_env:main |
| 38 | + services: |
| 39 | + minio: |
| 40 | + image: bitnami/minio:2021.3.17 |
| 41 | + env: |
| 42 | + MINIO_ACCESS_KEY: 123456 |
| 43 | + MINIO_SECRET_KEY: 12345678 |
| 44 | + steps: |
| 45 | + - uses: https://code.forgejo.org/actions/checkout@v3 |
| 46 | + - uses: https://code.forgejo.org/actions/setup-go@v4 |
| 47 | + with: |
| 48 | + go-version: ">=1.20.0" |
| 49 | + - run: | |
| 50 | + git config --add safe.directory '*' |
| 51 | + chown -R gitea:gitea . /go |
| 52 | + - run: | |
| 53 | + su gitea -c 'make deps-backend' |
| 54 | + - run: | |
| 55 | + su gitea -c 'make backend' |
| 56 | + env: |
| 57 | + TAGS: bindata |
| 58 | + - run: | |
| 59 | + su gitea -c 'make unit-test-coverage test-check' |
| 60 | + timeout-minutes: 50 |
| 61 | + env: |
| 62 | + RACE_ENABLED: 'true' |
| 63 | + TAGS: bindata |
| 64 | + test-mysql: |
| 65 | + runs-on: docker |
| 66 | + needs: [lint-backend, checks-backend] |
| 67 | + container: |
| 68 | + image: codeberg.org/forgejo/test_env:main |
| 69 | + services: |
| 70 | + mysql8: |
| 71 | + image: mysql:8-debian |
| 72 | + env: |
| 73 | + MYSQL_ALLOW_EMPTY_PASSWORD: yes |
| 74 | + MYSQL_DATABASE: testgitea |
| 75 | + # |
| 76 | + # See also https://codeberg.org/forgejo/forgejo/issues/976 |
| 77 | + # |
| 78 | + cmd: ['mysqld', '--innodb-adaptive-flushing=OFF', '--innodb-buffer-pool-size=4G', '--innodb-log-buffer-size=128M', '--innodb-flush-log-at-trx-commit=0', '--innodb-flush-log-at-timeout=30', '--innodb-flush-method=nosync', '--innodb-fsync-threshold=1000000000'] |
| 79 | + steps: |
| 80 | + - uses: https://code.forgejo.org/actions/checkout@v3 |
| 81 | + - uses: https://code.forgejo.org/actions/setup-go@v4 |
| 82 | + with: |
| 83 | + go-version: ">=1.20.0" |
| 84 | + - run: | |
| 85 | + git config --add safe.directory '*' |
| 86 | + chown -R gitea:gitea . /go |
| 87 | + - run: | |
| 88 | + su gitea -c 'make deps-backend' |
| 89 | + - run: | |
| 90 | + su gitea -c 'make backend' |
| 91 | + env: |
| 92 | + TAGS: bindata |
| 93 | + - run: | |
| 94 | + su gitea -c 'make test-mysql8-migration test-mysql8' |
| 95 | + timeout-minutes: 50 |
| 96 | + env: |
| 97 | + TAGS: bindata |
| 98 | + USE_REPO_TEST_DIR: 1 |
| 99 | + test-pgsql: |
| 100 | + runs-on: docker |
| 101 | + needs: [lint-backend, checks-backend] |
| 102 | + container: |
| 103 | + image: codeberg.org/forgejo/test_env:main |
| 104 | + services: |
| 105 | + minio: |
| 106 | + image: bitnami/minio:2021.3.17 |
| 107 | + env: |
| 108 | + MINIO_ACCESS_KEY: 123456 |
| 109 | + MINIO_SECRET_KEY: 12345678 |
| 110 | + pgsql: |
| 111 | + image: postgres:15 |
| 112 | + env: |
| 113 | + POSTGRES_DB: test |
| 114 | + POSTGRES_PASSWORD: postgres |
| 115 | + steps: |
| 116 | + - uses: https://code.forgejo.org/actions/checkout@v3 |
| 117 | + - uses: https://code.forgejo.org/actions/setup-go@v4 |
| 118 | + with: |
| 119 | + go-version: ">=1.20.0" |
| 120 | + - run: | |
| 121 | + git config --add safe.directory '*' |
| 122 | + chown -R gitea:gitea . /go |
| 123 | + - run: | |
| 124 | + su gitea -c 'make deps-backend' |
| 125 | + - run: | |
| 126 | + su gitea -c 'make backend' |
| 127 | + env: |
| 128 | + TAGS: bindata |
| 129 | + - run: | |
| 130 | + su gitea -c 'make test-pgsql-migration test-pgsql' |
| 131 | + timeout-minutes: 50 |
| 132 | + env: |
| 133 | + TAGS: bindata gogit |
| 134 | + RACE_ENABLED: true |
| 135 | + TEST_TAGS: gogit |
| 136 | + USE_REPO_TEST_DIR: 1 |
| 137 | + test-sqlite: |
| 138 | + runs-on: docker |
| 139 | + needs: [lint-backend, checks-backend] |
| 140 | + container: |
| 141 | + image: codeberg.org/forgejo/test_env:main |
| 142 | + steps: |
| 143 | + - uses: https://code.forgejo.org/actions/checkout@v3 |
| 144 | + - uses: https://code.forgejo.org/actions/setup-go@v4 |
| 145 | + with: |
| 146 | + go-version: ">=1.20.0" |
| 147 | + - run: | |
| 148 | + git config --add safe.directory '*' |
| 149 | + chown -R gitea:gitea . /go |
| 150 | + - run: | |
| 151 | + su gitea -c 'make deps-backend' |
| 152 | + - run: | |
| 153 | + su gitea -c 'make backend' |
| 154 | + env: |
| 155 | + TAGS: bindata gogit sqlite sqlite_unlock_notify |
| 156 | + - run: | |
| 157 | + su gitea -c 'make test-sqlite-migration test-sqlite' |
| 158 | + timeout-minutes: 50 |
| 159 | + env: |
| 160 | + TAGS: bindata gogit sqlite sqlite_unlock_notify |
| 161 | + RACE_ENABLED: true |
| 162 | + TEST_TAGS: gogit sqlite sqlite_unlock_notify |
| 163 | + USE_REPO_TEST_DIR: 1 |
0 commit comments