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
53 changes: 53 additions & 0 deletions .github/actions/oocana-python/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "setup oocana-python"
description: "setup oocana-python on ubuntu-latest with optional layer"
inputs:
token:
description: "GitHub token"
required: true
default: ${{ github.token }}
create-layer:
description: "create layer"
required: false
default: "false"
ref:
description: "GitHub ref"
required: false
default: ""
path:
description: "GitHub path"
required: false
default: "."

runs:
using: "composite"
steps:
- uses: actions/checkout@v4
with:
repository: oomol/oocana-python
path: ${{ inputs.path }}
ref: ${{ inputs.ref }}
token: ${{ inputs.token }}
- uses: pdm-project/setup-pdm@v4
with:
cache: true
python-version: "3.10"
python-version-file: ${{ inputs.path }}/pyproject.toml
cache-dependency-path: ${{ inputs.path }}/pdm.lock
- name: install dependencies
run: pdm install
shell: bash
working-directory: ${{ inputs.path }}
- name: build
run: pdm build
shell: bash
working-directory: ${{ inputs.path }}
- name: static check
run: pdm check
shell: bash
working-directory: ${{ inputs.path }}
- name: create-layer
if: ${{ inputs.create-layer != 'false' }}
run: |
python ./scripts/layer.py
shell: bash
working-directory: ${{ inputs.path }}
42 changes: 42 additions & 0 deletions .github/workflows/oocana-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "setup oocana-python action"
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- ".github/workflows/oocana-python.yml"
- "scripts/**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
action-test:
runs-on: ubuntu-latest
env:
OVMLAYER_LOG: /tmp/ovmlayer.log
steps:
- uses: actions/checkout@v4
- uses: oomol/oocana-rust/.github/actions/ovmlayer@main
with:
rootfs: https://github.com/oomol/ovmlayer-rootfs/releases/download/base-rootfs%400.3.0/amd64-rootfs.tar
token: ${{ secrets.ACCESS_REPO }}
- name: setup oocana-python action without layer
uses: ./.github/actions/oocana-python
with:
ref: ${{ github.sha }}
path: "oocana-python"
- name: setup oocana-python action with layer
uses: ./.github/actions/oocana-python
with:
ref: ${{ github.sha }}
create-layer: "true"
path: "oocana-python"
- name: upload log
if: failure()
uses: actions/upload-artifact@v4
with:
name: ovmlayer-log
path: /tmp/ovmlayer.log
Loading