Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mgree committed Jan 23, 2025
1 parent 3258c95 commit 76b2199
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:

- name: Check version numbers
run: ./version.sh

package-python:
strategy:
fail-fast: false
matrix:
os:
- macos-11
- macos-latest
- ubuntu-latest

runs-on: ${{ matrix.os }}
Expand All @@ -38,30 +38,30 @@ jobs:
echo Unsupported RUNNER_OS=$RUNNER_OS
exit 1
fi
- name: Checkout code
uses: actions/checkout@v4

- name: Build wheels
uses: pypa/[email protected]

- name: Upload binary wheel
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ format('bdist.{0}', matrix.os) }}
path: wheelhouse/libdash-*.whl

- name: Build source distribution (Linux only)
if: contains(matrix.os, 'ubuntu')
run: python setup.py sdist

- name: Upload source distribution (from Linux)
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: contains(matrix.os, 'ubuntu')
with:
name: sdist
path: dist/libdash-*.tar.gz

build-both-and-compare:
strategy:
fail-fast: true
Expand All @@ -84,17 +84,17 @@ jobs:
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: true

- name: Install and test OCaml bindings
run: opam install --with-test --working-dir .

# we don't reuse the wheels so that all of the CI runs can happen concurrently
- name: Install Python directly
run: sudo pip3 install .

- name: Test Python bindings
run: make -C python test

- name: Compare OCaml and Python bindings
run: opam exec -- make -C test test

Expand All @@ -105,10 +105,10 @@ jobs:
- build-both-and-compare
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')

steps:
- name: Download distributions
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4

- name: Rename distributions
run: |
Expand All @@ -118,7 +118,7 @@ jobs:
mv sdist/libdash-*.tar.gz dist/
echo Look on my Works, ye Mighty, and despair!
ls dist
- name: Deploy 'latest' release on GH
uses: marvinpinto/action-automatic-releases@latest
with:
Expand All @@ -135,8 +135,8 @@ jobs:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
verbose: true
repository_url: https://test.pypi.org/legacy/
skip_existing: true
skip_existing: true

- name: Deploy tagged release on PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ on:
# push:
schedule:
- cron: '20 13 * * *'

jobs:
ocaml:
strategy:
fail-fast: false
matrix:
os:
- macos-12
- macos-11
- ubuntu-18.04
- ubuntu-20.04
- macos-14
- macos-15
- ubuntu-22.04
- ubuntu-24.04
ocaml-compiler:
- 4.14.x
- 5.2.x

runs-on: ${{ matrix.os }}

Expand All @@ -34,7 +35,7 @@ jobs:
- name: Test OPAM executables
run: test "$(echo hi | opam exec -- shell_to_json | opam exec -- json_to_shell)" = "hi"

python:
strategy:
fail-fast: true
Expand Down Expand Up @@ -63,8 +64,8 @@ jobs:

- name: Install Python bindings from ${{ matrix.repository_url }}
run: pip install -v -i "${{ matrix.repository_url }}" --extra-index-url https://pypi.org/simple/ libdash

- name: Test Python library
run: |
RT="$(printf 'import libdash\nasts = libdash.parse("-", True)\nfor (ast, lines, linno_before, linno_after) in asts:\n print(libdash.to_string(ast))\n')"
test "$(echo hi | python -c "$RT")" = "hi"
test "$(echo hi | python -c "$RT")" = "hi"

0 comments on commit 76b2199

Please sign in to comment.