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 56c5663 commit ba8c36f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 40 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
42 changes: 3 additions & 39 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-project:
needs: deploy-action-code
if: ${{ always() && !failure() && !cancelled() }}
name: Test Project Build
runs-on: macos-12
strategy:
Expand Down Expand Up @@ -95,8 +69,6 @@ jobs:
run: ls ~/Library/Developer/Xcode/DerivedData/ | grep -q '^TestProject.*'

test-workspace:
needs: deploy-action-code
if: ${{ always() && !failure() && !cancelled() }}
name: Test Workspace Build
runs-on: macos-12
strategy:
Expand Down Expand Up @@ -155,8 +127,6 @@ jobs:
run: ls ~/Library/Developer/Xcode/DerivedData/ | grep -q '^TestProject.*'

test-package:
needs: deploy-action-code
if: ${{ always() && !failure() && !cancelled() }}
name: Test SPM Package Build
runs-on: macos-12
strategy:
Expand Down Expand Up @@ -200,8 +170,6 @@ jobs:
run: ls ~/Library/Developer/Xcode/DerivedData/ | grep -q '^TestPackage.*'

test-dry-run-project:
needs: deploy-action-code
if: ${{ always() && !failure() && !cancelled() }}
name: Dry Run Project Build
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -381,8 +349,6 @@ jobs:
fi
test-dry-run-workspace:
needs: deploy-action-code
if: ${{ always() && !failure() && !cancelled() }}
name: Dry Run Workspace Build
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -566,8 +532,6 @@ jobs:
fi
test-dry-run-package:
needs: deploy-action-code
if: ${{ always() && !failure() && !cancelled() }}
name: Dry Run SPM Package Build
runs-on: ubuntu-latest
strategy:
Expand Down

0 comments on commit ba8c36f

Please sign in to comment.