Skip to content

Commit

Permalink
ci: updating workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
paulushcgcj committed Sep 18, 2024
1 parent ff446ad commit 68f82db
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 34 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
pull_request:
branches:
- main
push:
branches:
- main

permissions:
contents: read
Expand Down Expand Up @@ -86,34 +83,3 @@ jobs:
echo "The output does not match the expected feature"
exit 1
fi
publish:
name: Publish
runs-on: ubuntu-22.04
needs: [test-action, test-typescript]
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Conventional Changelog Update
uses: TriPSs/conventional-changelog-action@v5
id: changelog
with:
github-token: ${{ github.token }}
output-file: 'CHANGELOG.md'
skip-version-file: 'true'
skip-commit: 'true'
git-push: 'true'

- name: Create Release
uses: softprops/action-gh-release@v2
if: ${{ steps.changelog.outputs.tag != '' }}
continue-on-error: true
env:
GITHUB_TOKEN: ${{ github.token }}
with:
token: ${{ github.token }}
tag_name: ${{ steps.changelog.outputs.tag }}
name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
116 changes: 116 additions & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Continuous Integration

on:
push:
branches:
- main

permissions:
contents: read

jobs:
test-typescript:
name: TypeScript Tests
runs-on: ubuntu-22.04

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm

- name: Install Dependencies
id: npm-ci
run: npm ci

- name: Check Format
id: npm-format-check
run: npm run format:check

- name: Lint
id: npm-lint
run: npm run lint

- name: Test
id: npm-ci-test
run: npm run coverage

test-action:
name: GitHub Actions Test
runs-on: ubuntu-22.04

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm

- name: Install Dependencies
id: npm-ci
run: npm ci

- name: Build
id: npm-build
run: npm run package

- name: Test Local Action
id: test-action
uses: ./
with:
issue: 1

- name: Print Output
id: output
run: echo "${{ steps.test-action.outputs.feature }}"

- name: Validate Feature
id: validate
run: |
# Check if the content of the output is the same as the .github/sample.feature file
if [ "$(cat .github/sample.feature)" != "${{ steps.test-action.outputs.feature }}" ]; then
echo "The output does not match the expected feature"
exit 1
fi
publish:
name: Publish
runs-on: ubuntu-22.04
needs: [test-action, test-typescript]
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Conventional Changelog Update
uses: TriPSs/conventional-changelog-action@v5
id: changelog
with:
github-token: ${{ github.token }}
output-file: 'CHANGELOG.md'
skip-version-file: 'true'
skip-commit: 'true'
git-push: 'true'

- name: Create Release
uses: softprops/action-gh-release@v2
if: ${{ steps.changelog.outputs.tag != '' }}
continue-on-error: true
env:
GITHUB_TOKEN: ${{ github.token }}
with:
token: ${{ github.token }}
tag_name: ${{ steps.changelog.outputs.tag }}
name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}

0 comments on commit 68f82db

Please sign in to comment.