Skip to content
/ avo Public
forked from avo-hq/avo

Commit 469636c

Browse files
Upgrade to Avo 3 (avo-hq#2044)
Co-authored-by: Paul Bob <[email protected]>
1 parent de72553 commit 469636c

File tree

712 files changed

+13325
-13793
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

712 files changed

+13325
-13793
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Steps to reproduce the behavior:
3838

3939
- [ ] Community
4040
- [ ] Pro
41+
- [ ] Advanced
4142

4243
**Are you using Avo monkey patches, overriding views or view components?**
4344
<!-- (Mark [x] inside the brackets) -->

.github/PULL_REQUEST_TEMPLATE.md

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Fixes # (issue)
1818
- [ ] I have made corresponding changes to the [documentation](https://github.com/avo-hq/avodocs)
1919
- [ ] I have added tests that prove my fix is effective or that my feature works
2020

21+
## Screenshots
22+
<!-- Does the PR introduce any visual changes? Can you show us before and after? -->
2123

2224
## Manual review steps
2325
<!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration. -->

.github/delete-release-notes-draft.js

-36
This file was deleted.

.github/get-release-notes-from-draft.js

-28
This file was deleted.

.github/release-drafter.yml

+2
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@ template: |
4747
More information and release video [here](https://avohq.io/releases/$NEXT_PATCH_VERSION)
4848
4949
$CHANGES
50+
51+
For more information, check out [Avo's release notes page](https://avohq.io/releases)
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Build release notes
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
update_release_notes:
10+
uses: avo-hq/support/.github/workflows/build-release-notes.yml@main

.github/workflows/codeball.yml

-20
This file was deleted.

.github/workflows/create-release.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Create release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
workflow_dispatch:
8+
tags:
9+
- 'v*.*.*'
10+
11+
jobs:
12+
create_release:
13+
uses: avo-hq/support/.github/workflows/create-release.yml@main

.github/workflows/feature-tests.yml

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Feature Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- 1.x
8+
- 2.x
9+
push:
10+
branches:
11+
- main
12+
- 1.x
13+
- 2.x
14+
15+
env:
16+
RAILS_ENV: test
17+
PGHOST: localhost
18+
PGUSER: postgres
19+
PGPORT: 5432
20+
POSTGRES_HOST: localhost
21+
POSTGRES_USERNAME: postgres
22+
POSTGRES_PORT: 5432
23+
BUNDLE_PATH_RELATIVE_TO_CWD: true
24+
AVO_LICENSE_KEY: license_123
25+
BUNDLE_RUBYGEMS__PKG__GITHUB__COM: adrianthedev:${{secrets.GH_REGISTRY_AVO_FILTERS_TOKEN}}
26+
27+
jobs:
28+
feature_specs:
29+
strategy:
30+
matrix:
31+
ruby:
32+
- '3.2.2'
33+
rails:
34+
- '6.0'
35+
- '6.1'
36+
- '7.0'
37+
- '7.1'
38+
runs-on: ubuntu-latest
39+
40+
env:
41+
RAILS_VERSION: ${{matrix.rails}}
42+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails }}_ruby_${{ matrix.ruby }}.gemfile
43+
44+
services:
45+
postgres:
46+
image: postgres:10.8
47+
ports: ["5432:5432"]
48+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
49+
50+
steps:
51+
- uses: actions/checkout@v3
52+
53+
- name: Set up Ruby
54+
uses: ruby/setup-ruby@v1
55+
with:
56+
# bundler-cache: true
57+
bundler: default
58+
ruby-version: ${{ matrix.ruby }}
59+
60+
- uses: actions/cache@v3
61+
with:
62+
path: vendor/bundle
63+
key: ${{ runner.os }}-test-gems-${{ hashFiles('**/Gemfile.lock') }}
64+
restore-keys: |
65+
${{ runner.os }}-test-gems-${{ hashFiles('**/Gemfile.lock') }}
66+
67+
- name: Bundle install
68+
run: |
69+
bundle config path vendor/bundle
70+
bundle install --jobs 4 --retry 3
71+
bin/rails db:create
72+
bin/rails db:migrate
73+
74+
- name: Get yarn cache directory path
75+
id: test-yarn-cache-dir-path
76+
run: echo "::set-output name=dir::$(yarn cache dir)"
77+
78+
- uses: actions/cache@v3
79+
id: test-yarn-cache
80+
with:
81+
path: ${{ steps.test-yarn-cache-dir-path.outputs.dir }}
82+
key: ${{ runner.os }}-test-yarn-${{ hashFiles('**/yarn.lock') }}
83+
restore-keys: |
84+
${{ runner.os }}-test-yarn-${{ hashFiles('**/yarn.lock') }}
85+
86+
- name: Yarn install the dummy app
87+
run: |
88+
cd spec/dummy
89+
yarn
90+
91+
- name: Yarn install
92+
run: yarn
93+
94+
- name: Build assets
95+
env:
96+
RAILS_ENV: production
97+
NODE_ENV: production
98+
run: |
99+
yarn build:js
100+
yarn build:custom-js
101+
yarn build:css
102+
103+
- name: Run tests
104+
id: run_tests
105+
run: bundle exec rspec spec/features
106+
107+
- uses: actions/upload-artifact@v3
108+
if: always() && steps.run_tests.outcome == 'failure'
109+
with:
110+
name: rspec_failed_screenshots_rails_${{ matrix.rails }}_ruby_${{ matrix.ruby }}
111+
path: ./spec/dummy/tmp/screenshots

.github/workflows/label-pr.yml

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
name: PR Labeler
1+
name: Label PR
2+
23
on:
3-
pull_request:
4+
pull_request_target:
45
types: [opened]
56

67
permissions:
78
contents: read
89

910
jobs:
10-
pr-labeler:
11+
label-pr:
1112
permissions:
12-
pull-requests: write
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: TimonVS/pr-labeler-action@v3
16-
env:
17-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
contents: read # for TimonVS/pr-labeler-action to read config file
14+
pull-requests: write # for TimonVS/pr-labeler-action to add labels in PR
15+
uses: avo-hq/support/.github/workflows/label-pr.yml@main

.github/workflows/lint.yml

+7-26
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,8 @@
1-
name: Linting
2-
on: [pull_request]
3-
jobs:
4-
standardrb:
5-
name: runner / standardrb
6-
runs-on: ubuntu-latest
7-
steps:
8-
- name: Check out code
9-
uses: actions/checkout@v1
10-
- name: standardrb
11-
uses: adrianthedev/action-standardrb@master
12-
with:
13-
github_token: ${{ secrets.github_token }}
14-
reporter: github-pr-review # Default is github-pr-check
15-
rubocop_version: 0.1.6
16-
rubocop_flags: --format progress
1+
name: Lint
2+
3+
on:
4+
- pull_request
175

18-
eslint:
19-
name: runner / eslint
20-
runs-on: ubuntu-latest
21-
steps:
22-
- uses: actions/checkout@v1
23-
- run: yarn
24-
- name: eslint
25-
uses: reviewdog/action-eslint@v1
26-
with:
27-
reporter: github-pr-review
6+
jobs:
7+
lint:
8+
uses: avo-hq/support/.github/workflows/lint.yml@main

.github/workflows/release-notes.yml

-20
This file was deleted.

.github/workflows/release.yml .github/workflows/release.yml-old

+16-7
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v3
2020
- name: Set up Ruby
2121
uses: ruby/setup-ruby@v1
2222
with:
2323
ruby-version: 3.1.0
2424

25-
- uses: actions/cache@v1
25+
- uses: actions/cache@v3
2626
with:
2727
path: vendor/bundle
2828
key: ${{ runner.os }}-production-gems-${{ hashFiles('**/Gemfile.lock') }}
@@ -38,7 +38,7 @@ jobs:
3838
id: production-yarn-cache-dir-path
3939
run: echo "::set-output name=dir::$(yarn cache dir)"
4040

41-
- uses: actions/cache@v1
41+
- uses: actions/cache@v3
4242
id: production-yarn-cache
4343
with:
4444
path: ${{ steps.production-yarn-cache-dir-path.outputs.dir }}
@@ -52,6 +52,9 @@ jobs:
5252
- name: Yarn check integrity
5353
run: yarn check --integrity
5454

55+
- name: Symlink avo packages
56+
run: bundle exec rails avo:sym_link
57+
5558
- name: Build assets
5659
run: |
5760
yarn prod:build:js
@@ -66,21 +69,27 @@ jobs:
6669
echo "::set-output name=tag::$(sed "s|refs/tags/v||" <<< ${{ github.ref }})"
6770

6871
- name: Get release notes
72+
uses: actions/github-script@v6
6973
id: get_release_notes
70-
run: |
71-
echo "::set-output name=release_notes::$(node .github/get-release-notes-from-draft.js ${{github.repository}} ${{secrets.GITHUB_TOKEN}})"
74+
with:
75+
script: |
76+
const {data: releases} = await github.rest.repos.listReleases({
77+
owner: context.repo.owner,
78+
repo: context.repo.repo,
79+
});
80+
return releases.find((r) => r.draft)?.body || "No draft release found."
7281

7382
- name: Create Release
7483
id: create_release
75-
if: ${{steps.get_release_notes.outputs.release_notes != ''}}
84+
if: ${{steps.get_release_notes.outputs.result != ''}}
7685
uses: actions/create-release@v1
7786
env:
7887
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7988
with:
8089
tag_name: ${{ github.ref }}
8190
release_name: Release ${{ github.ref }}
8291
body: |
83-
${{fromJson(steps.get_release_notes.outputs.release_notes)}}
92+
${{fromJson(steps.get_release_notes.outputs.result)}}
8493
draft: false
8594
prerelease: false
8695

0 commit comments

Comments
 (0)