Skip to content

Commit

Permalink
Test Linux/Mac/Windows (simplified) and publish to depend on it.
Browse files Browse the repository at this point in the history
  • Loading branch information
daniperez committed Jan 13, 2024
1 parent ead1958 commit 5be9ea0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ name: Upload Python Package
on:
push:
branches: [ "main" ]

workflow_call:
permissions:
contents: read

jobs:
tests:
uses: ./.github/workflows/tests.yml
build:
needs: [tests]
name: Build distribution 📦
environment: pypi
runs-on: ubuntu-latest
Expand All @@ -31,7 +33,7 @@ jobs:
python3 -m pip install --upgrade pip build --user
- name: Build package
run: python3 -m build
- name: Publish package
- name: Save wheels as artifacts
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/test-mac.yml

This file was deleted.

26 changes: 14 additions & 12 deletions .github/workflows/test-win.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Test Windows
name: Test on multiple platforms
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_call:
permissions:
contents: read
jobs:
build:
environment: pypi
runs-on: windows-latest
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.x
Expand All @@ -20,16 +23,15 @@ jobs:
python-version: "3.7"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build
python -m pip install --upgrade pip build
- name: Build wheel & install
shell: bash
run: |
python -m build
$VALE_VERSION = (Get-Content pyproject.toml | Select-String '^version').ToString().Split('"')[1]
Write-Host "Installing $VALE_VERSION ..."
ls ./dist/*
export VALE_VERSION="$(cat pyproject.toml | grep '^version' | cut -d ' ' -f 3 | sed -e 's/"//g')"
echo "Installing $VALE_VERSION ..."
python -m pip install -v "./dist/vale-$VALE_VERSION-py3-none-any.whl"
- name: Test
working-directory: ${{ runner.temp }}
- name: Test Vale
run: |
vale sync --config ${{ github.workspace }}\vale.ini.sample
vale --config ${{ github.workspace }}\vale.ini.sample
vale --help
6 changes: 0 additions & 6 deletions vale.ini.sample

This file was deleted.

0 comments on commit 5be9ea0

Please sign in to comment.