Skip to content

Commit

Permalink
Split backend and frontend builds
Browse files Browse the repository at this point in the history
  • Loading branch information
adamyeats committed Mar 19, 2024
1 parent adf2e2c commit f366185
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 34 deletions.
62 changes: 30 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,34 @@ on:
- main

jobs:
build:
build-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Test backend
uses: magefile/mage-action@v3
with:
version: latest

- name: Build backend
uses: magefile/mage-action@v3
with:
version: latest
args: buildAll

- uses: actions/upload-artifact@v4
with:
name: backend-dist
path: dist/
retention-days: 1

build-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -37,39 +64,10 @@ jobs:
- name: Build frontend
run: yarn build

- name: Check for backend
id: check-for-backend
run: |
if [ -f "Magefile.go" ]
then
echo "has-backend=true" >> $GITHUB_OUTPUT
fi
- name: Setup Go environment
if: steps.check-for-backend.outputs.has-backend == 'true'
uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Test backend
if: steps.check-for-backend.outputs.has-backend == 'true'
uses: magefile/mage-action@v3
with:
version: latest
# args: coverage

- name: Build backend
if: steps.check-for-backend.outputs.has-backend == 'true'
uses: magefile/mage-action@v3
with:
version: latest
args: buildAll

- uses: actions/upload-artifact@v4
with:
name: plugin-dist
name: frontend-dist
path: dist/
retention-days: 1

timeout-minutes: 60

6 changes: 4 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
e2e:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4

Expand All @@ -26,9 +27,10 @@ jobs:
- name: Download plugin-dist artifact
uses: actions/download-artifact@v4
with:
name: plugin-dist
path: dist/
github-token: ${{ secrets.GH_PAT }}
merge-multiple: true
path: dist/
pattern: "*-dist"
repository: ${{ github.repository }}
run-id: ${{ github.event.workflow_run.id }}

Expand Down

0 comments on commit f366185

Please sign in to comment.