Skip to content

Add function as the type of SLS functions #770

Add function as the type of SLS functions

Add function as the type of SLS functions #770

Workflow file for this run

name: tests
on:
pull_request:
branches:
- main
jobs:
unit-test:
strategy:
matrix:
go: [ 1.19 ]
runs-on: [self-hosted, public, linux, x64]
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Checkout code
uses: actions/checkout@v2
- name: Prepare external plugin tests
run: |
go build -buildmode=plugin -o tests/yor_plugins/example/extra_tags.so tests/yor_plugins/example/*.go
go build -buildmode=plugin -o tests/yor_plugins/tag_group_example/extra_tag_groups.so tests/yor_plugins/tag_group_example/*.go
- name: Test
run: go build -v && go test ./src/...
linter:
name: golangci-lint
runs-on: [self-hosted, public, linux, x64]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v1
with:
tool_name: golangci-lint
fail_on_error: true
golangci_lint_flags: "--skip-dirs tests/yor_plugins"
integration-tests:
strategy:
matrix:
go: [ 1.19 ]
runs-on: [self-hosted, public, linux, x64]
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Checkout code
uses: actions/checkout@v2
- name: build
run: go build
- name: Clone Terragoat - vulnerable terraform
uses: actions/checkout@v2
with:
repository: bridgecrewio/terragoat # clone https://github.com/bridgecrewio/terragoat/
fetch-depth: 0
clean: false
path: 'terragoat'
ref: 063dc2db3bb036160ed39d3705508ee8293a27c8
- name: Run yor
run: |
git config --local user.email "action@github.com"
./yor list-tags -g code2cloud,git > list-tags-result.txt
./yor tag -d terragoat -o json --output-json-file result.json
- name: Run integration tests
run: go test -race ./tests/integration/...