-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (70 loc) · 2.29 KB
/
tests.yml
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
name: All Specs
on:
pull_request:
types: [opened, reopened, synchronize]
paths-ignore:
- 'docs/**'
push:
branches:
- dev
- release/*
paths-ignore:
- 'docs/**'
schedule:
- cron: "0 0 * * *"
jobs:
all:
name: Run Tests
timeout-minutes: 30
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
CI_RETRY_COUNT: 3
steps:
- name: Checkout Core
uses: actions/checkout@v4
with:
repository: opf/openproject
ref: stable/14
- name: Checkout Project
uses: actions/checkout@v4
with:
path: modules/openproject-open_desk
# Copy the files needed to setup the project for tests
- name: Setup plugin
run: |
cp modules/openproject-open_desk/docker/ci/Dockerfile docker/ci/Dockerfile
cp modules/openproject-open_desk/docker/ci/db_entrypoint.sh docker/ci/entrypoint.sh
cp modules/openproject-open_desk/docker/ci/Gemfile.plugins ./Gemfile.plugins
- name: Cache Built Image
id: cache_docker
uses: runs-on/cache@v4
with:
path: cache/docker
key: "${{ runner.os }}-docker-ci-${{ hashFiles('docker-compose.ci.yml', 'docker/ci/*', '.ruby-version', 'bin/ci') }}"
- name: Restore Image from cache
if: steps.cache_docker.outputs.cache-hit == 'true'
run: docker load -i cache/docker/image.tar
- name: Cache GEM
uses: actions/cache@v4
with:
path: cache/bundle
key: gem-bookworm-${{ hashFiles('.ruby-version') }}-${{ hashFiles('Gemfile.lock') }}
restore-keys: |
gem-bookworm-${{ hashFiles('.ruby-version') }}-
- name: Cache Node Modules
uses: actions/cache@v4
with:
path: cache/node
key: node-${{ hashFiles('package.json', 'frontend/package-lock.json') }}
restore-keys: |
node-
- name: Build Setup Test Environment
run: bin/ci setup-tests
- name: Non Feature Specs
run: bin/ci run-units
- name: Feature Specs
run: bin/ci run-features
- name: Save CI Image to cache
if: steps.cache_docker.outputs.cache-hit != 'true'
run: mkdir -p cache/docker && docker save openproject/ci:v1 -o cache/docker/image.tar