Skip to content

Commit

Permalink
Split test and deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
ffried committed Oct 24, 2022
1 parent cff3582 commit dfe4473
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 36 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy Action Code

on:
push:
branches: [ master ]
paths-ignore: [ 'dist/*.js' ]

jobs:
deploy-action-code:
if: ${{ github.event_name == 'push' }}
name: Deploy Action Code
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo npm i -g typescript @vercel/ncc
- uses: actions/[email protected]
with:
token: ${{ secrets.BOT_TOKEN }}
- name: Generate action code
run: npm run deploy
- name: Configure repository
env:
BOT_USERNAME: ${{ secrets.BOT_USERNAME }}
run: |
git config user.name "${BOT_USERNAME}"
git config user.email "${BOT_USERNAME}@users.noreply.github.com"
- name: Commit changes
run: |
if ! git diff --exit-code --quiet; then
git add .
git commit -m "[AUTO] Update generated code"
git push
fi
2 changes: 1 addition & 1 deletion .github/workflows/tag-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/[email protected]
- uses: sersoft-gmbh/running-release-tags-action@master
if: github.event.release.prerelease == false
if: ${{ github.event.release.prerelease == false }}
with:
update-full-release: true
github-token: ${{ secrets.GITHUB_TOKEN }}
36 changes: 1 addition & 35 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,12 @@ name: Tests
on:
push:
branches: [ master ]
paths-ignore: [ 'dist/*.js' ]
paths: [ 'dist/*.js' ]
pull_request:
branches: [ master ]

jobs:
deploy-action-code:
if: ${{ github.event_name == 'push' }}
name: Deploy Action Code
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo npm i -g typescript @vercel/ncc
- uses: actions/[email protected]
with:
token: ${{ secrets.BOT_TOKEN }}
- name: Generate action code
run: npm run deploy
- name: Configure repository
env:
BOT_USERNAME: ${{ secrets.BOT_USERNAME }}
run: |
git config user.name "${BOT_USERNAME}"
git config user.email "${BOT_USERNAME}@users.noreply.github.com"
- name: Commit changes
run: |
if ! git diff --exit-code --quiet; then
git add .
git commit -m "[AUTO] Update generated code"
git push
fi
test-defaults:
needs: deploy-action-code
if: ${{ always() && !failure() && !cancelled() }}
name: Test Default Inputs
env:
INPUT_TAG: 1.2.3
Expand Down Expand Up @@ -91,8 +63,6 @@ jobs:
git diff --no-index -- expected.txt actual.txt
test-customized:
needs: deploy-action-code
if: ${{ always() && !failure() && !cancelled() }}
name: Test Customized Inputs
strategy:
matrix:
Expand Down Expand Up @@ -205,8 +175,6 @@ jobs:
git diff --no-index -- expected.txt actual.txt
test-from-env:
needs: deploy-action-code
if: ${{ always() && !failure() && !cancelled() }}
name: Test With Environment
strategy:
matrix:
Expand Down Expand Up @@ -307,8 +275,6 @@ jobs:
git diff --no-index -- expected.txt actual.txt
test-invalid:
needs: deploy-action-code
if: ${{ always() && !failure() && !cancelled() }}
name: Test Invalid Inputs
strategy:
matrix:
Expand Down

0 comments on commit dfe4473

Please sign in to comment.