Skip to content

Commit

Permalink
Merge pull request #80 from lazy-actions/feat/organize-workflows
Browse files Browse the repository at this point in the history
Organize GitHub Actions workflows
  • Loading branch information
homoluctus authored Jun 3, 2021
2 parents f55d002 + 3278c29 commit d537ee8
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 146 deletions.
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

0 comments on commit d537ee8

Please sign in to comment.