Skip to content

Commit

Permalink
chore: update upload workflow to trigger on push to main and 3.* bran…
Browse files Browse the repository at this point in the history
…ches

- replace dotrun with build in the test workflow

Signed-off-by: Peter Makowski <[email protected]>
  • Loading branch information
petermakowski committed Jun 18, 2024
1 parent 03a331c commit 3fa9f00
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 20 deletions.
47 changes: 30 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [16.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Restore node_modules
id: yarn-cache
uses: actions/cache@v3
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install
Expand All @@ -35,36 +35,49 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [16.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v3
- name: Restore node_modules
id: yarn-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: CYPRESS_INSTALL_BINARY=0 yarn install
- run: yarn test:ci

run-dotrun:
build:
name: Build
timeout-minutes: 15
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- name: Install dotrun
uses: canonical/install-dotrun@main
- name: Install dependencies
run: dotrun install
- uses: actions/checkout@v4
- name: Restore node_modules
id: yarn-cache
uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: CYPRESS_INSTALL_BINARY=0 yarn install
- name: Build assets
run: dotrun --env CI=false build
- name: Run dotrun
run: dotrun &
- name: Wait for MAAS UI to be ready
run: dotrun wait-on-ui
run: yarn build
- name: Serve build
run: yarn serve --host --port=8400 --base=/ &
- name: Wait for UI to be ready
run: yarn wait-on-ui
8 changes: 5 additions & 3 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Build upload
on:
pull_request_target:
types: [closed]
push:
branches:
- main
- "3.*"
jobs:
upload-build:
if: github.event.pull_request.merged == true
if: github.repository_owner == 'canonical'
name: Upload build artifacts
runs-on: ubuntu-22.04
env:
Expand Down

0 comments on commit 3fa9f00

Please sign in to comment.