Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Organize GitHub Actions workflows #80

Merged
merged 3 commits into from
Jun 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build

on:
push:
branches:
- master
paths:
- "**.ts"
- "package.json"
- "yarn.lock"
- "tsconfig.json"

jobs:
build:
name: Transpile Typescript
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: '14'

- name: Setup workspace
run: yarn install --frozen-lockfile

- name: Transpile
run: yarn run build

- name: Push changes
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add .
git commit -m "build: Transpile" || echo "No changes to commit"
git push origin HEAD
57 changes: 57 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Integration Test

on:
workflow_run:
workflows: ["Build"]
types:
- completed

env:
IMAGE_NAME: alpine:3.10.3

jobs:
test1:
name: Test parameters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Pull docker image
run: docker pull ${{ env.IMAGE_NAME }}

- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
image: ${{ env.IMAGE_NAME }}
issue_label: trivy,vulnerability,test
issue_title: Security Alert Test
issue_assignee: homoluctus

test2:
name: Getting image name from enviroment variable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Pull docker image
run: docker pull ${{ env.IMAGE_NAME }}

- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue_label: trivy,vulnerability,test
issue_title: Security Alert Test
issue_assignee: homoluctus

test3:
name: Not create issue
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Pull docker image
run: docker pull ${{ env.IMAGE_NAME }}

- uses: ./
with:
issue: 'false'
36 changes: 0 additions & 36 deletions .github/workflows/release.yml

This file was deleted.

102 changes: 0 additions & 102 deletions .github/workflows/test.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@ on:
pull_request:
paths:
- 'src/**'
- 'dist/**'
- tsconfig.json
- package.json
- yarn.lock

jobs:
jest:
name: Test with jest
runs-on: ubuntu-18.04
test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: '12.x'

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ on:
jobs:
scan:
name: Daily Vulnerability Scan
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Pull docker image
run: docker pull sample

- uses: homoluctus/gitrivy@v1.0.0
- uses: lazy-actions/gitrivy@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
image: sample
Expand Down