Browse Source

refactor(workflows): align GitHub workflow conventions

Cosmetic pass at aligning the conventions used in ZMK's workflows with GitHub's examples.  Based on examples found at:
https://github.com/actions/starter-workflows

PR #433
xmkb
innovaker 4 years ago committed by Pete Johanson
parent
commit
7babe7f185
  1. 21
      .github/workflows/build.yml
  2. 4
      .github/workflows/clang-format-lint.yml
  3. 7
      .github/workflows/doc-checks.yml
  4. 21
      .github/workflows/test.yml

21
.github/workflows/build.yml

@ -1,3 +1,5 @@
name: Build
on: on:
push: push:
paths: paths:
@ -8,12 +10,9 @@ on:
- ".github/workflows/build.yml" - ".github/workflows/build.yml"
- "app/**" - "app/**"
name: Build
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Build Test
strategy: strategy:
matrix: matrix:
board: [proton_c, nice_nano, bluemicro840_v1, nrfmicro_13] board: [proton_c, nice_nano, bluemicro840_v1, nrfmicro_13]
@ -47,8 +46,6 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Cache west modules - name: Cache west modules
timeout-minutes: 2
continue-on-error: true
uses: actions/cache@v2 uses: actions/cache@v2
env: env:
cache-name: cache-zephyr-modules cache-name: cache-zephyr-modules
@ -63,32 +60,34 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build- ${{ runner.os }}-build-
${{ runner.os }}- ${{ runner.os }}-
- name: West Init timeout-minutes: 2
continue-on-error: true
- name: West init
uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" uses: "docker://zmkfirmware/zephyr-west-action-arm:latest"
id: west-init id: west-init
with: with:
args: 'init "-l app"' args: 'init "-l app"'
- name: West Update - name: West update
uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" uses: "docker://zmkfirmware/zephyr-west-action-arm:latest"
id: west-update id: west-update
with: with:
args: "update" args: "update"
- name: West Config Zephyr Base - name: West config Zephyr base
uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" uses: "docker://zmkfirmware/zephyr-west-action-arm:latest"
id: west-config id: west-config
with: with:
args: 'config "--global zephyr.base-prefer configfile"' args: 'config "--global zephyr.base-prefer configfile"'
- name: West Zephyr Export - name: West Zephyr export
uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" uses: "docker://zmkfirmware/zephyr-west-action-arm:latest"
id: west-zephyr-export id: west-zephyr-export
with: with:
args: "zephyr-export" args: "zephyr-export"
- name: West Build - name: West build
uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" uses: "docker://zmkfirmware/zephyr-west-action-arm:latest"
id: west-build id: west-build
with: with:
args: 'build "-s app -b ${{ matrix.board }} -- -DSHIELD=${{ matrix.shield }}"' args: 'build "-s app -b ${{ matrix.board }} -- -DSHIELD=${{ matrix.shield }}"'
- name: Archive Build - name: Archive build
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
if: ${{ matrix.board != 'proton_c' }} if: ${{ matrix.board != 'proton_c' }}
with: with:

4
.github/workflows/clang-format-lint.yml

@ -1,4 +1,4 @@
name: clang-format-lint name: Clang Format
on: on:
push: push:
@ -21,8 +21,6 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: clang-format lint
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: DoozyX/clang-format-lint-action@v0.9 - uses: DoozyX/clang-format-lint-action@v0.9

7
.github/workflows/doc-checks.yml

@ -1,4 +1,4 @@
name: doc-checks name: Docs Checks
on: on:
push: push:
@ -13,8 +13,6 @@ on:
jobs: jobs:
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: ESLint
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: bahmutov/npm-install@v1 - uses: bahmutov/npm-install@v1
@ -26,12 +24,11 @@ jobs:
prettier: prettier:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Prettier name: Prettier
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: bahmutov/npm-install@v1 - uses: bahmutov/npm-install@v1
with: with:
working-directory: docs working-directory: docs
- name: Prettier Check - name: Prettier check
run: npm run prettier:check run: npm run prettier:check
working-directory: docs working-directory: docs

21
.github/workflows/test.yml

@ -1,3 +1,5 @@
name: Tests
on: on:
push: push:
paths: paths:
@ -10,20 +12,15 @@ on:
- "app/tests/**" - "app/tests/**"
- "app/src/**" - "app/src/**"
name: Test
jobs: jobs:
integration_test: integration_test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Integration Tests
steps: steps:
# To use this repository's private action, # To use this repository's private action,
# you must check out the repository # you must check out the repository
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Cache west modules - name: Cache west modules
timeout-minutes: 2
continue-on-error: true
uses: actions/cache@v2 uses: actions/cache@v2
env: env:
cache-name: cache-zephyr-modules cache-name: cache-zephyr-modules
@ -38,33 +35,35 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build- ${{ runner.os }}-build-
${{ runner.os }}- ${{ runner.os }}-
- name: West Init timeout-minutes: 2
continue-on-error: true
- name: West init
uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" uses: "docker://zmkfirmware/zephyr-west-action-arm:latest"
id: west-init id: west-init
with: with:
args: 'init "-l app"' args: 'init "-l app"'
- name: West Update - name: West update
uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" uses: "docker://zmkfirmware/zephyr-west-action-arm:latest"
id: west-update id: west-update
with: with:
args: "update" args: "update"
- name: West Config Zephyr Base - name: West config Zephyr base
uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" uses: "docker://zmkfirmware/zephyr-west-action-arm:latest"
id: west-config id: west-config
with: with:
args: 'config "--global zephyr.base-prefer configfile"' args: 'config "--global zephyr.base-prefer configfile"'
- name: West Zephyr Export - name: West Zephyr export
uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" uses: "docker://zmkfirmware/zephyr-west-action-arm:latest"
id: west-zephyr-export id: west-zephyr-export
with: with:
args: "zephyr-export" args: "zephyr-export"
- name: Test All - name: Test all
uses: "docker://zmkfirmware/zephyr-west-action-arm:latest" uses: "docker://zmkfirmware/zephyr-west-action-arm:latest"
id: west-build id: west-build
with: with:
entrypoint: /bin/bash entrypoint: /bin/bash
args: '-c "west test"' args: '-c "west test"'
- name: Archive Build - name: Archive build
if: ${{ always() }} if: ${{ always() }}
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:

Loading…
Cancel
Save