This repository has been archived by the owner on Jun 24, 2022. It is now read-only.
forked from prettier/plugin-ruby
-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (85 loc) · 2.23 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
85
86
87
88
89
90
91
name: Main
on:
- push
- pull_request
jobs:
ci:
name: CI
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
ruby:
- "2.5"
- "2.6"
- "2.7"
- "3.0"
# Turning off truffleruby because I'm not sure why it's failing
# - truffleruby
runs-on: ${{ matrix.os }}
env:
PLUGIN_RUBY_CI: true
steps:
- uses: actions/checkout@master
# Setup ruby dependencies
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ${{ matrix.ruby }}
# Setup node dependencies
- uses: actions/setup-node@v2-beta
with:
node-version: 12.x
- id: yarn-cache
run: echo "::set-output name=directory::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.directory }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile
# Actually run tests and lint
- name: Lint and test
run: |
yarn check-format
yarn test
bundle exec rake test
lint:
name: Lint
runs-on: ubuntu-latest
env:
PLUGIN_RUBY_CI: true
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v2-beta
with:
node-version: 12.x
- id: yarn-cache
run: echo "::set-output name=directory::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.directory }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile
- run: yarn lint
automerge:
name: AutoMerge
needs:
- ci
- lint
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
steps:
- uses: actions/github-script@v3
with:
script: |
github.pulls.merge({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.pull_request.number
})