Skip to content

Commit

Permalink
ci: set up GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
yudai-nkt committed Jul 27, 2024
1 parent 4265053 commit 24f7d2e
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 22 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ indent_style = tab

[*.sh]
end_of_line = lf

[*.yaml]
indent_size = 2
20 changes: 0 additions & 20 deletions .github/workflows/build_binaries.yaml

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/build_firmware.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Largely based on QMK's builtin workflow but tailored for my usage with Vial
name: Build Vial firmware

on:
push:
branches:
- main
paths:
- keyboards/**
- vial-qmk/**
workflow_dispatch:

permissions:
contents: write

jobs:
build:
name: Build Userspace Firmware
runs-on: ubuntu-latest
container: qmkfm/base_container
steps:
- name: Checkout Userspace
uses: actions/checkout@v4
with:
token: ${{ github.token }}
submodules: recursive
- name: Install QMK CLI
run: |
python3 -m pip install --upgrade qmk
python3 -m pip install -r vial-qmk/requirements.txt
- name: Configure QMK CLI
run: |
qmk config userspace_compile.parallel=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
qmk config user.qmk_home=$GITHUB_WORKSPACE/vial-qmk
qmk config user.overlay_dir=$GITHUB_WORKSPACE
- name: Validate userspace
run: |
qmk userspace-doctor
- name: Build
run: |
qmk userspace-compile -e DUMP_CI_METADATA=yes || touch .failed
# Generate the step summary markdown
./qmk_firmware/util/ci/generate_failure_markdown.sh > $GITHUB_STEP_SUMMARY || true
# Truncate to a maximum of 1MB to deal with GitHub workflow limit
truncate --size='<960K' $GITHUB_STEP_SUMMARY || true
# Exit with failure if the compilation stage failed
[ ! -f .failed ] || exit 1
- name: Upload binaries
uses: actions/upload-artifact@v4
if: always() && !cancelled()
continue-on-error: true
with:
name: Firmware
path: |
*.bin
*.hex
*.uf2
publish:
name: 'QMK Userspace Publish'
uses: qmk/.github/.github/workflows/qmk_userspace_publish.yml@main
if: always() && !cancelled()
needs: build
6 changes: 4 additions & 2 deletions qmk.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"userspace_version": "1.0",
"build_targets": []
}
"build_targets": [
["aki27/cocot46plus", "vial"]
]
}

0 comments on commit 24f7d2e

Please sign in to comment.