From 3a3ebcf659c1faa82e05d4b5c8e60720743c7f15 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Tue, 17 Oct 2023 14:06:25 -0400 Subject: [PATCH] chore(ci): add workflow for testing ionicons dev build (#28345) Issue number: N/A --------- ## What is the current behavior? Testing Ionicons in Ionic is currently difficult. Developers need to a) create a dev build of Ionicons, b) create a branch in Ionic, c) install the dev build in Ionic core, d) push the branch, and e) create a draft PR to watch the CI process run. ## What is the new behavior? - Introduces a workflow dispatch option for our CI process. This allows developers to run the CI process for any branch without creating PR. - I also added an optional input so devs can specify the ionicons version if they want to pass a special version. ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information --- .github/workflows/actions/build-core/action.yml | 12 ++++++++++++ .github/workflows/build.yml | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/.github/workflows/actions/build-core/action.yml b/.github/workflows/actions/build-core/action.yml index 17e92a01db..b2b9fd75ed 100644 --- a/.github/workflows/actions/build-core/action.yml +++ b/.github/workflows/actions/build-core/action.yml @@ -1,5 +1,10 @@ name: 'Build Ionic Core' description: 'Build Ionic Core' +inputs: + ionicons-version: + description: 'The NPM tag of ionicons to install.' + type: string + required: false runs: using: 'composite' steps: @@ -11,6 +16,13 @@ runs: run: npm install working-directory: ./core shell: bash + # If an Ionicons version was specified install that. + # Otherwise just use the version defined in the package.json. + - name: Install Ionicons Version + if: inputs.ionicons-version != '' + run: npm install ionicons@${{ inputs.ionicons-version }} + working-directory: ./core + shell: bash - name: Build Core run: npm run build -- --ci working-directory: ./core diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fe8f9f2e2d..c026db383d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,12 @@ on: pull_request: branches: [ '**' ] merge_group: + workflow_dispatch: + inputs: + ionicons_npm_release_tag: + required: false + type: string + description: What version of ionicons should be pulled from NPM? Use this if you want to test a custom version of Ionicons with Ionic. # When pushing a new commit we should # cancel the previous test run to not @@ -18,6 +24,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./.github/workflows/actions/build-core + with: + ionicons-version: ${{ inputs.ionicons_npm_release_tag }} test-core-clean-build: needs: [build-core]