Skip to content

Commit

Permalink
Add CI job based on pixi (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro authored Dec 4, 2024
1 parent 034fc00 commit b1709b9
Show file tree
Hide file tree
Showing 6 changed files with 17,039 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
47 changes: 47 additions & 0 deletions .github/workflows/test-pixi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Run tests with pixi

on:
# on demand
workflow_dispatch:
inputs:
delete_pixi_lock:
description: 'If true, delete pixi.lock, to test against the latest version of dependencies.'
required: true
default: 'false'
pull_request:
schedule:
# * is a special character in YAML so you have to quote this string
# Execute a "nightly" build twice a week 2 AM UTC
- cron: '0 2 * * 2,5'

jobs:
pixi-test:
name: '[pixi:${{ matrix.os }}]'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Windows disabled as a workaround for https://github.com/ami-iit/mujoco-urdf-loader/issues/11
os: [
ubuntu-latest,
macos-latest
]
steps:
- uses: actions/checkout@v4

# On periodic jobs and when delete_pixi_lock option is true, delete the pixi.lock to check that the project compiles with latest version of dependencies
- name: Delete pixi.lock on scheduled jobs or if delete_pixi_lock is true
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.delete_pixi_lock == 'true')
shell: bash
run: |
rm pixi.lock
- name: Set up pixi
uses: prefix-dev/[email protected]

- name: Print pixi info
run: pixi info

- name: Build and test the project
run: pixi run -e testing test

40 changes: 40 additions & 0 deletions .github/workflows/update-pixi-lockfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Update lockfiles

permissions:
contents: write
pull-requests: write

on:
workflow_dispatch:

jobs:
pixi-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up pixi
uses: prefix-dev/[email protected]
with:
run-install: false

- name: Install pixi-diff-to-markdown
run: pixi global install pixi-diff-to-markdown

- name: Update lockfiles
run: |
set -o pipefail
pixi update --json | pixi exec pixi-diff-to-markdown >> diff.md
- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update pixi lockfile
title: Update pixi lockfile
body-path: diff.md
branch: update-pixi
base: main
labels: pixi
delete-branch: true
add-paths: pixi.lock
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,7 @@ $RECYCLE.BIN/
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/python,visualstudiocode,linux,windows,jupyternotebooks

# pixi environments
.pixi
*.egg-info
Loading

0 comments on commit b1709b9

Please sign in to comment.