Skip to content

Commit

Permalink
Migrate CI away from erb templates (#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
anttiharju authored Aug 9, 2024
1 parent 44399ca commit edb31b7
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 234 deletions.
24 changes: 0 additions & 24 deletions .github/templates/jobs/build.erb

This file was deleted.

18 changes: 0 additions & 18 deletions .github/templates/jobs/test.erb

This file was deleted.

27 changes: 0 additions & 27 deletions .github/templates/pull_request.yml.erb

This file was deleted.

24 changes: 0 additions & 24 deletions .github/templates/release.yml.erb

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build

on: workflow_call

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: "Install"
run: |
npm install
- name: "Prettier"
run: |
npm run format-check
- name: "Lint"
run: |
npm run lint
- name: "Test"
run: |
npm run test
- name: "build"
run: |
npm run build
npm run package
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: "Build action for test"
run: |
npm install
npm run all
git clean -fXd
- name: Test executing the action
uses: ./
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
enforce: false

release:
runs-on: ubuntu-22.04
name: "Build and release action"
needs: [build, test]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: true
- name: Configure git
uses: smartlyio/github-actions@git-init-userinfo-v1
- name: Release flow
uses: smartlyio/github-actions@release-action-node-v1
with:
dry_run: ${{ github.event_name == 'pull_request' }}
token: "${{ secrets.GITHUB_TOKEN }}"
17 changes: 8 additions & 9 deletions .github/workflows/check_release_label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@ name: Check Labels
on:
pull_request:
branches:
- master
- master
types:
- opened
- labeled
- unlabeled
- synchronize
- opened
- labeled
- unlabeled
- synchronize

jobs:
check_labels:
runs-on: ubuntu-22.04
steps:
- uses: smartlyio/check-versioning-action@v5
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: smartlyio/check-versioning-action@v5
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76 changes: 0 additions & 76 deletions .github/workflows/pull_request.generated.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Pull Request

on:
pull_request:
branches: [master]

jobs:
build:
name: Build
uses: ./.github/workflows/build.yml
secrets: inherit
56 changes: 0 additions & 56 deletions .github/workflows/release.generated.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Release

on:
push:
branches: [master]

jobs:
build:
name: Build
uses: ./.github/workflows/build.yml
secrets: inherit

0 comments on commit edb31b7

Please sign in to comment.