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 6fe13f0 commit 55fb76c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 32 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deploy Action Code

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

jobs:
deploy-action-code:
name: Deploy Action Code
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo npm i -g typescript @vercel/ncc
- uses: actions/checkout@v3.1.0
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 @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.1.0
- uses: sersoft-gmbh/running-release-tags-action@v2.1.0
- uses: sersoft-gmbh/running-release-tags-action@v2.1.1
if: ${{ github.event.release.prerelease == false }}
with:
update-full-release: true
Expand Down
34 changes: 3 additions & 31 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,14 @@ name: Tests
on:
push:
branches: [ master ]
paths-ignore: [ 'dist/*.js' ]
paths:
- 'dist/*.js'
- '.github/workflows/tests.yml'
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/checkout@v3.1.0
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-spm:
needs: deploy-action-code
if: ${{ always() && !failure() && !cancelled() }}
name: Test using SPM
strategy:
matrix:
Expand Down Expand Up @@ -77,8 +51,6 @@ jobs:
run: test -f "${INPUT_OUTPUT}/index.html"

test-xcode:
needs: deploy-action-code
if: ${{ always() && !failure() && !cancelled() }}
name: Test using Xcode
env:
INPUT_PACKAGE_PATH: __test__/TestProject
Expand Down

0 comments on commit 55fb76c

Please sign in to comment.