-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (80 loc) · 2.11 KB
/
main.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
82
83
84
name: "Lettuce Meet CI Workflow"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-api:
name: Build and Test Rails API
runs-on: ubuntu-latest
env:
api-dir: ./api
services:
postgres:
image: postgres:11.6
ports: ["5432:5432"]
redis:
image: redis
ports: ["6379:6379"]
steps:
- uses: actions/checkout@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.2
- name: Install PostgreSQL
run: sudo apt-get -yqq install libpq-dev
- name: Run bundle install
working-directory: ${{env.api-dir}}
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Setup Database
working-directory: ${{env.api-dir}}
env:
RAILS_ENV: test
PGHOST: localhost
PGUSER: postgres
run: bin/rails db:create db:schema:load
- name: Build and test with rspec
working-directory: ${{env.api-dir}}
env:
RAILS_ENV: test
PGHOST: localhost
PGUSER: postgres
run: bundle exec rspec spec
build-frontend:
name: Build and Test Frontend
runs-on: ubuntu-latest
env:
api-dir: ./frontend
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
with:
run: yarn install
start: yarn dev
component: true
auto-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Minor version for each merge
id: taggerDryRun
uses: anothrNick/github-tag-action@1.55.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
DRY_RUN: true
- name: echo new tag
run: |
echo "The next tag version will be: ${{ steps.taggerDryRun.outputs.new_tag }}"
- name: echo tag
run: |
echo "The current tag is: ${{ steps.taggerDryRun.outputs.tag }}"
- name: echo part
run: |
echo "The version increment was: ${{ steps.taggerDryRun.outputs.part }}"