Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/actions/build-core/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'Build Ionicons'
description: 'Build Ionicons'
runs:
using: 'composite'
steps:
- uses: actions/checkout@v3
with:
# Checkout the latest commit in this branch
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-node@v3

- name: Cache Node Modules
uses: actions/cache@v3
env:
cache-name: node-modules
with:
path: ./node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./package-lock.json') }}-v1
- name: Install Dependencies
run: npm install
shell: bash
- name: Build
run: npm run build
shell: bash
- uses: ./.github/workflows/actions/upload-archive
with:
name: ionicons-build
output: IoniconsBuild.zip
paths: dist components icons
19 changes: 19 additions & 0 deletions .github/workflows/actions/download-archive/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Archive Download'
description: 'Downloads and decompresses an archive from a previous job'
inputs:
path:
description: 'Input archive name'
filename:
description: 'Input file name'
name:
description: 'Archive name'
runs:
using: 'composite'
steps:
- uses: actions/download-artifact@v2
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
- name: Exract Archive
run: unzip -q -o ${{ inputs.path }}/${{ inputs.filename }}
shell: bash
22 changes: 22 additions & 0 deletions .github/workflows/actions/test-spec/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Test Spec'
description: 'Test Spec'
runs:
using: 'composite'
steps:
- uses: actions/setup-node@v3

- name: Cache Node Modules
uses: actions/cache@v3
env:
cache-name: node-modules
with:
path: ./node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./package-lock.json') }}-v1
- uses: ./.github/workflows/actions/download-archive
with:
name: ionicons-build
path: .
filename: IoniconsBuild.zip
- name: Test
run: npm run test.spec -- --ci
shell: bash
19 changes: 19 additions & 0 deletions .github/workflows/actions/upload-archive/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Archive Upload'
description: 'Compresses and uploads an archive to be reused across jobs'
inputs:
paths:
description: 'Paths to files or directories to archive'
output:
description: 'Output file name'
name:
description: 'Archive name'
runs:
using: 'composite'
steps:
- name: Create Archive
run: zip -q -r ${{ inputs.output }} ${{ inputs.paths }}
shell: bash
- uses: actions/upload-artifact@v2
with:
name: ${{ inputs.name }}
path: ${{ inputs.output }}
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'Ionicons Build'

on:
pull_request:
branches: [ '**' ]

# When pushing a new commit we should
# cancel the previous test run to not
# consume more runners than we need to.
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build-core:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# Checkout the latest commit in this branch
ref: ${{ github.event.pull_request.head.sha }}
- uses: ./.github/workflows/actions/build-core

test-spec:
needs: [build-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/actions/test-spec
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"build.component": "stencil build",
"collection.copy": "node scripts/collection-copy.js",
"start": "stencil build --dev --watch --serve",
"test": "stencil test --spec",
"test.spec": "stencil test --spec",
"release": "np --no-2fa",
"version": "npm run build"
},
Expand Down