Skip to content

Commit 9841af3

Browse files
committed
update GH CI from rails template
1 parent 3279685 commit 9841af3

4 files changed

Lines changed: 72 additions & 88 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
version: 2
22
updates:
33
- package-ecosystem: bundler
4-
directory: "/"
4+
directory: "/www"
55
schedule:
66
interval: daily
77
open-pull-requests-limit: 10
88
- package-ecosystem: github-actions
9-
directory: "/"
9+
directory: "/www"
1010
schedule:
1111
interval: daily
1212
open-pull-requests-limit: 10

.github/workflows/cli.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: CLI
22

3-
on: [push]
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
47

58
jobs:
69
build:

.github/workflows/www.yml

Lines changed: 66 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,78 @@
11
name: WWW
22

3-
on: [push]
3+
defaults:
4+
run:
5+
working-directory: ./www
6+
7+
on:
8+
pull_request:
9+
push:
10+
branches: [main]
411

512
jobs:
6-
build:
13+
scan_ruby:
714
runs-on: ubuntu-latest
815

916
steps:
10-
- uses: actions/checkout@v1
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Ruby
21+
uses: ruby/setup-ruby@v1
22+
with:
23+
ruby-version: .ruby-version
24+
bundler-cache: true
25+
26+
- name: Scan for common Rails security vulnerabilities using static analysis
27+
run: bin/brakeman --no-pager
1128

12-
- name: Set the NODE_VERSION env variable from NVM
13-
run: echo NODE_VERSION=$(cat www/.nvmrc) >> $GITHUB_ENV
29+
lint:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v4
1434

15-
- uses: actions/setup-node@v2
35+
- name: Set up Ruby
36+
uses: ruby/setup-ruby@v1
1637
with:
17-
node-version: "${{ env.NODE_VERSION }}"
38+
ruby-version: .ruby-version
39+
bundler-cache: true
1840

19-
- name: Install dependencies
20-
run: cd www && npm install
41+
- name: Lint code for consistent style
42+
run: bin/rubocop -f github
43+
44+
test:
45+
runs-on: ubuntu-latest
2146

22-
- name: Lint
23-
run: cd www && npm run lint
47+
# services:
48+
# redis:
49+
# image: redis
50+
# ports:
51+
# - 6379:6379
52+
# options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
53+
steps:
54+
- name: Install packages
55+
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git pkg-config google-chrome-stable
56+
57+
- name: Checkout code
58+
uses: actions/checkout@v4
59+
60+
- name: Set up Ruby
61+
uses: ruby/setup-ruby@v1
62+
with:
63+
ruby-version: .ruby-version
64+
bundler-cache: true
65+
66+
- name: Run tests
67+
env:
68+
RAILS_ENV: test
69+
# REDIS_URL: redis://localhost:6379/0
70+
run: bin/rails db:test:prepare test test:system
71+
72+
- name: Keep screenshots from failed system tests
73+
uses: actions/upload-artifact@v4
74+
if: failure()
75+
with:
76+
name: screenshots
77+
path: ${{ github.workspace }}/tmp/screenshots
78+
if-no-files-found: ignore

www/.github/workflows/ci.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

0 commit comments

Comments
 (0)