Skip to content

ci: use neo-pkgdev

ci: use neo-pkgdev #29

Workflow file for this run

name: ci
run-name: "ci: ${{ github.event.pull_request.title }}"
on:
pull_request:
paths:
- projects/**/*
- .github/workflows/ci.yml
concurrency:
group: ci/${{ github.event.pull_request.head.ref }}
cancel-in-progress: true
jobs:
plan:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.process-diff.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- run: |
sudo apt-get update
sudo apt-get install -y ca-certificates
- run: go install github.com/machbase/neo-pkgdev@3eba73b1866ea518c705c98f769637be88946329
- uses: technote-space/get-diff-action@v6
id: get-diff
with:
PATTERNS: projects/**/package.yml
- name: ProcessDiff
id: process-diff
run: |
if [ -n "${{ steps.get-diff.outputs.diff }}" ]; then
for x in ${{ steps.get-diff.outputs.diff }}; do
y=$(echo $x | sed 's#projects/\(.*\)/[^/]*#\1#')
RESULT="$RESULT ${y//$'\n'/}"
done
else
RESULT="neo-pkg-web-example"
fi
neo-pkgdev plan $RESULT
- run: echo '${{ steps.process-diff.outputs.matrix }}' | jq
build:
needs: plan
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.plan.outputs.matrix) }}
runs-on: ${{ matrix.platform.os }}
container: ${{ matrix.platform.container }}
name: ${{ matrix.pkg }} ${{ github.workspace }}
env:
PKGS_PATH: ${{ github.workspace }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- run: |
apt-get update
apt-get install -y ca-certificates
go install github.com/machbase/neo-pkgdev@3eba73b1866ea518c705c98f769637be88946329
mkdir /tmp/pkgs
- name: audit
run: neo-pkgdev audit ${{ matrix.pkg }}
- name: build
run: neo-pkgdev build ${{ matrix.pkg }}