This repository has been archived by the owner on Apr 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (66 loc) · 1.9 KB
/
ci_ruby.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
name: CI Ruby
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
env:
CI: true
strategy:
matrix:
ruby-version: ['2.7', '3.0', '3.1']
steps:
- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Run the setup script
run: ./bin/setup
- name: Run tests
run: bundle exec rake test
- name: Code Coverage
run: |
echo "COVERAGE=$(./bin/code_coverage)" >> $GITHUB_ENV
REF=${{ github.ref }}
echo "github.ref: $REF"
IFS='/' read -ra PATHS <<< "$REF"
BRANCH_NAME="${PATHS[1]}_${PATHS[2]}"
echo $BRANCH_NAME
echo "BRANCH=$(echo ${BRANCH_NAME})" >> $GITHUB_ENV
- name: Create the Coverage Badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 82fd98743c74c8c36a9b04c9e325755e
filename: amber_extension_generator__${{ env.BRANCH }}.json
label: Test Coverage
message: ${{ env.COVERAGE }}
color: success
namedLogo: ruby
lint:
runs-on: ubuntu-latest
env:
CI: true
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
- name: Run the setup script
run: ./bin/setup
# Add or replace any other lints here
- name: Security audit dependencies
run: bundle exec bundle audit --update
- name: Lint Ruby files
run: bundle exec rubocop --parallel