ci: merge changelog generation into release workflow (#228) #510
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| - cron: '0 12 * * 5' | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: test-action | |
| cancel-in-progress: ${{ github.ref != 'main' }} | |
| jobs: | |
| test-vitest: | |
| name: Vitest Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .node-version | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run format:check | |
| - run: npm run lint | |
| - run: npm test | |
| test-action-basic: | |
| name: GitHub Actions Test (Basic) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| env: | |
| BRANCH: test-action-basic | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Test Action | |
| id: test-action | |
| uses: ./ | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| files: | | |
| test.txt | |
| commit-message: Add Dummy Content | |
| - name: Print Action Output | |
| run: echo "${{ steps.test-action.outputs.commit-sha }}" | |
| - name: Clean up test action environment | |
| if: always() | |
| uses: ./.github/actions/cleanup | |
| with: | |
| branch: ${{ env.BRANCH }} | |
| test-action-branch: | |
| name: GitHub Actions Test (Custom Branch) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| needs: test-action-basic | |
| env: | |
| BRANCH: test-action-branch | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: generate dummy content | |
| shell: bash | |
| run: | | |
| touch test.txt && echo 'xyz' > test.txt | |
| - name: Test Action | |
| id: test-action | |
| uses: ./ | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| files: | | |
| test.txt | |
| commit-message: Add Dummy Content | |
| branch-name: ${{ env.BRANCH }} | |
| branch-push-force: true | |
| - name: Print Action Output | |
| run: echo "${{ steps.test-action.outputs.commit-sha }}" | |
| - name: Clean up test action environment | |
| if: always() | |
| uses: ./.github/actions/cleanup | |
| with: | |
| branch: ${{ env.BRANCH }} | |
| test-action-workspace: | |
| name: GitHub Actions Test (Workspace) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| needs: test-action-branch | |
| env: | |
| BRANCH: test-action-workspace | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: generate dummy content | |
| shell: bash | |
| run: | | |
| mkdir dummy | |
| touch dummy/test.txt && echo '123' > dummy/test.txt | |
| - name: Test Action | |
| id: test-action | |
| uses: ./ | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| files: | | |
| test.txt | |
| commit-message: Add Dummy Content | |
| branch-name: ${{ env.BRANCH }} | |
| workspace: dummy | |
| - name: Print Action Output | |
| run: echo "${{ steps.test-action.outputs.commit-sha }}" | |
| - name: Clean up test action environment | |
| if: always() | |
| uses: ./.github/actions/cleanup | |
| with: | |
| branch: ${{ env.BRANCH }} | |
| test-action-glob: | |
| name: GitHub Actions Test (Glob) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| needs: test-action-workspace | |
| env: | |
| BRANCH: test-action-glob | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: generate dummy content | |
| shell: bash | |
| run: | | |
| touch test_1.txt && echo 'abc123' > test_1.txt | |
| touch test_2.txt && echo 'abc456' > test_2.txt | |
| - name: Test Action | |
| id: test-action | |
| uses: ./ | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| files: | | |
| test*.txt | |
| commit-message: Add Dummy Content | |
| branch-name: ${{ env.BRANCH }} | |
| - name: Print Action Output | |
| run: echo "${{ steps.test-action.outputs.commit-sha }}" | |
| - name: Clean up test action environment | |
| if: always() | |
| uses: ./.github/actions/cleanup | |
| with: | |
| branch: ${{ env.BRANCH }} | |
| test-action-tag: | |
| name: GitHub Actions Test (Tag) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| needs: test-action-glob | |
| env: | |
| TAG: v1.2.3 | |
| BRANCH: test-action-tag | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Test Action | |
| id: test-action | |
| uses: ./ | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| branch-name: ${{ env.BRANCH }} | |
| tag: ${{ env.TAG }} | |
| - name: Print Action Output | |
| run: | | |
| echo "[commit] ${{ steps.test-action.outputs.commit-sha }}" | |
| echo "[tag] ${{ steps.test-action.outputs.tag }}" | |
| - name: Clean up test action environment | |
| if: always() | |
| uses: ./.github/actions/cleanup | |
| with: | |
| branch: ${{ env.BRANCH }} | |
| tag: ${{ env.TAG }} | |
| test-action-file-tag: | |
| name: GitHub Actions Test (File & Tag) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| needs: test-action-tag | |
| env: | |
| BRANCH: test-action-file-tag | |
| TAG: 4.5.6 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: generate dummy content | |
| shell: bash | |
| run: | | |
| touch test_1.txt && echo 'abc123' > test_1.txt | |
| touch test_2.txt && echo 'abc456' > test_2.txt | |
| - name: Test Action | |
| id: test-action | |
| uses: ./ | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| files: | | |
| test*.txt | |
| commit-message: Add Dummy Content | |
| branch-name: ${{ env.BRANCH }} | |
| tag: ${{ env.TAG }} | |
| - name: Print Action Output | |
| run: | | |
| echo "[commit] ${{ steps.test-action.outputs.commit-sha }}" | |
| echo "[tag] ${{ steps.test-action.outputs.tag }}" | |
| - name: Clean up test action environment | |
| if: always() | |
| uses: ./.github/actions/cleanup | |
| with: | |
| branch: ${{ env.BRANCH }} | |
| tag: ${{ env.TAG }} | |
| test-action-no-file-changes-tag: | |
| name: GitHub Actions Test (No File Changes & Tag) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| needs: test-action-file-tag | |
| env: | |
| BRANCH: test-action-no-file-changes-tag | |
| TAG: 7.8.9 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Test Action | |
| id: test-action | |
| uses: ./ | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| files: README.md | |
| commit-message: Add Dummy Content | |
| branch-name: ${{ env.BRANCH }} | |
| tag: ${{ env.TAG }} | |
| - name: Print Action Output | |
| run: | | |
| echo "[commit] ${{ steps.test-action.outputs.commit-sha }}" | |
| echo "[tag] ${{ steps.test-action.outputs.tag }}" | |
| - name: Clean up test action environment | |
| if: always() | |
| uses: ./.github/actions/cleanup | |
| with: | |
| branch: ${{ env.BRANCH }} | |
| tag: ${{ env.TAG }} |