11name : " [CI] ExtraUserFields"
2- on : " push"
2+ on :
3+ push :
4+ branches :
5+ - develop
6+ - release/*
7+ - " *-stable"
8+ pull_request :
9+ branches-ignore :
10+ - " chore/l10n*"
11+ paths :
12+ - " *"
13+ - " .github/**"
314
415env :
516 CI : " true"
617 RUBY_VERSION : 3.1.1
718 NODE_VERSION : 18.17.1
819
20+ concurrency :
21+ group : ${{ github.workflow }}-${{ github.head_ref || github.ref }}
22+ cancel-in-progress : true
23+
924jobs :
25+ build_app :
26+ uses : ./.github/workflows/build_app.yml
27+ secrets : inherit
28+ name : Build test application
29+
1030 lint :
31+ name : Lint code
1132 runs-on : ubuntu-latest
33+ timeout-minutes : 60
1234 steps :
13- - uses : actions/checkout@v2
35+ - uses : actions/checkout@v3
1436 with :
1537 fetch-depth : 1
1638 - uses : actions/setup-node@master
@@ -24,123 +46,11 @@ jobs:
2446 name : Lint Ruby files
2547 - run : bundle exec erblint app/**/*.erb
2648 name : Lint ERB files
49+
2750 tests :
2851 name : Tests
29- runs-on : ubuntu-latest
30- timeout-minutes : 30
31- services :
32- postgres :
33- image : postgres:11
34- ports : ["5432:5432"]
35- options : >-
36- --health-cmd pg_isready
37- --health-interval 10s
38- --health-timeout 5s
39- --health-retries 5
40- env :
41- POSTGRES_PASSWORD : postgres
42- env :
43- DATABASE_USERNAME : postgres
44- DATABASE_PASSWORD : postgres
45- DATABASE_HOST : localhost
46- steps :
47- - uses : rokroskar/workflow-run-cleanup-action@v0.3.0
48- if : " github.ref != 'refs/heads/develop'"
49- env :
50- GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
51- - uses : actions/checkout@v2.0.0
52- with :
53- fetch-depth : 1
54- - uses : ruby/setup-ruby@v1
55- with :
56- bundler-cache : true
57- - uses : actions/setup-node@v1
58- with :
59- node-version : ${{ env.NODE_VERSION }}
60- - name : Get npm cache directory path
61- id : npm-cache-dir-path
62- run : echo "::set-output name=dir::$(npm get cache)-extra_user_fields"
63- - uses : actions/cache@v2
64- id : npm-cache
65- with :
66- path : ${{ steps.npm-cache-dir-path.outputs.dir }}
67- key : npm-${{ hashFiles('**/package-lock.json') }}
68- restore-keys : |
69- npm-
70- - run : bundle exec rake test_app
71- name : Create test app
72- - run : mkdir -p ./spec/decidim_dummy_app/tmp/screenshots
73- name : Create the screenshots folder
74- - uses : nanasess/setup-chromedriver@v2
75- - run : RAILS_ENV=test bundle exec rails assets:precompile
76- name : Precompile assets
77- working-directory : ./spec/decidim_dummy_app/
78- - run : bundle exec rspec --exclude-pattern "spec/system/**/*_spec.rb"
79- name : RSpec
80- - uses : codecov/codecov-action@v1
81- - uses : actions/upload-artifact@v2
82- if : always()
83- with :
84- name : screenshots
85- path : ./spec/decidim_dummy_app/tmp/screenshots
86- if-no-files-found : ignore
87- system-tests :
88- name : System tests
89- runs-on : ubuntu-latest
90- timeout-minutes : 30
91- services :
92- postgres :
93- image : postgres:11
94- ports : ["5432:5432"]
95- options : >-
96- --health-cmd pg_isready
97- --health-interval 10s
98- --health-timeout 5s
99- --health-retries 5
100- env :
101- POSTGRES_PASSWORD : postgres
102- env :
103- DATABASE_USERNAME : postgres
104- DATABASE_PASSWORD : postgres
105- DATABASE_HOST : localhost
106- steps :
107- - uses : rokroskar/workflow-run-cleanup-action@v0.3.0
108- if : " github.ref != 'refs/heads/develop'"
109- env :
110- GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
111- - uses : actions/checkout@v2.0.0
112- with :
113- fetch-depth : 1
114- - uses : ruby/setup-ruby@v1
115- with :
116- bundler-cache : true
117- - uses : actions/setup-node@v1
118- with :
119- node-version : ${{ env.NODE_VERSION }}
120- - name : Get npm cache directory path
121- id : npm-cache-dir-path
122- run : echo "::set-output name=dir::$(npm get cache)-extra_user_fields"
123- - uses : actions/cache@v2
124- id : npm-cache
125- with :
126- path : ${{ steps.npm-cache-dir-path.outputs.dir }}
127- key : npm-${{ hashFiles('**/package-lock.json') }}
128- restore-keys : |
129- npm-
130- - run : bundle exec rake test_app
131- name : Create test app
132- - run : mkdir -p ./spec/decidim_dummy_app/tmp/screenshots
133- name : Create the screenshots folder
134- - uses : nanasess/setup-chromedriver@v2
135- - run : RAILS_ENV=test bundle exec rails assets:precompile
136- name : Precompile assets
137- working-directory : ./spec/decidim_dummy_app/
138- - run : bundle exec rspec spec/system
139- name : RSpec
140- - uses : codecov/codecov-action@v1
141- - uses : actions/upload-artifact@v2
142- if : always()
143- with :
144- name : screenshots
145- path : ./spec/decidim_dummy_app/tmp/screenshots
146- if-no-files-found : ignore
52+ needs : build_app
53+ uses : ./.github/workflows/test_app.yml
54+ with :
55+ test_command : " bundle exec rspec --pattern './spec/**/*_spec.rb'"
56+ secrets : inherit
0 commit comments