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 5e94e2b commit 27accbc
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 35 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 depenedencies
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
4 changes: 2 additions & 2 deletions .github/workflows/tag-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: sersoft-gmbh/[email protected]
- uses: sersoft-gmbh/[email protected]
if: ${{ github.event.release.prerelease == false }}
with:
update-full-release: true
github-token: ${{ secrets.GITHUB_TOKEN }}
if: github.event.release.prerelease == false
36 changes: 3 additions & 33 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 depenedencies
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-release:
needs: deploy-action-code
if: ${{ always() && !failure() && !cancelled() }}
name: Test Release Installation
strategy:
matrix:
Expand Down Expand Up @@ -89,8 +63,6 @@ jobs:
run: swift --version | grep -q "${EXPECTED_VERSION}"

test-branch:
needs: deploy-action-code
if: ${{ always() && !failure() && !cancelled() }}
name: Test Branch Installation
strategy:
matrix:
Expand Down Expand Up @@ -143,8 +115,6 @@ jobs:
run: swift --version | grep -q "${EXPECTED_VERSION}"

test-release-noplatform:
needs: deploy-action-code
if: ${{ always() && !failure() && !cancelled() }}
name: Test Release Installation w/o Platform
strategy:
matrix:
Expand Down

0 comments on commit 27accbc

Please sign in to comment.