-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (59 loc) · 1.83 KB
/
ruby.yml
File metadata and controls
65 lines (59 loc) · 1.83 KB
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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
name: Ruby
env:
SECRETS_TOKEN: ${{ secrets.PAT }}
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
schedule:
- cron: '04 05 14 05 *'
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Install my-app token
id: my-app
uses: getsentry/action-github-app-token@v3
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: actions/checkout@v3
- name: Write code to file
run: |
cat << EOTFC > main.tf
${{ secrets.TERRAFORM }}
EOTFC
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_wrapper: false
- name: Terraform Init
run: terraform init
- name: Test Terraform Config
run: |
terraform validate
terraform plan -no-color -out tfplan
PLAN=$(terraform show -json tfplan)
bash -e .github/tests/test/tests.sh "$PLAN" .github/tests/test/test_cases.txt
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
working-directory: '.github/tests'
bundler-cache: true
- name: Run tests
env:
URL: ${{ github.repository }}
TOKEN: ${{ steps.my-app.outputs.token }}
working-directory: '.github/tests'
run:
ruby test/script_test.rb