From b1719d351ac8d7c5707379cec241215f1da18ffe Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Mon, 2 Jan 2023 21:33:10 -0600 Subject: [PATCH] Test on ubuntu, macos, and windows --- .github/actions/setup/action.yml | 32 +++++++++++++++++++++----------- .github/workflows/main.yml | 12 ++++++++++-- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index ed27eaa..1dd8aef 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -19,26 +19,36 @@ inputs: runs: using: composite steps: - - name: Setup Poetry cache + - name: Setup Poetry cache on Linux uses: actions/cache@v3 - if: inputs.install_dependencies == 'true' + if: runner.os == 'Linux' with: - path: ~/.local - key: poetry-${{ inputs.poetry_version }} - - name: Setup Poetry - uses: snok/install-poetry@v1 + key: poetry-${{ inputs.poetry_version }}-${{ inputs.python_version }}-${{ runner.os }}-${{ runner.arch }} + path: | + ~/.local/bin + ~/.local/share/pypoetry + - name: Setup Poetry cache on macOS + uses: actions/cache@v3 + if: runner.os == 'macOS' with: - version: ${{ inputs.poetry_version }} + key: poetry-${{ inputs.poetry_version }}-${{ inputs.python_version }}-${{ runner.os }}-${{ runner.arch }} + path: | + ~/.local/bin + ~/.local/share/pypoetry + ~/Library/Application Support/pypoetry - name: Setup Python uses: actions/setup-python@v4 - if: inputs.install_dependencies == 'true' with: - cache: poetry python-version: ${{ inputs.python_version }} - - name: Setup Python without cache + - name: Setup Poetry + uses: Gr1N/setup-poetry@v8 + with: + poetry-version: ${{ inputs.poetry_version }} + - name: Setup Python with cache uses: actions/setup-python@v4 - if: inputs.install_dependencies == 'false' + if: inputs.install_dependencies == 'true' with: + cache: poetry python-version: ${{ inputs.python_version }} - name: Check lockfile if: inputs.install_dependencies == 'true' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f5b1a57..b57d0c4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,11 +8,15 @@ on: jobs: test: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} timeout-minutes: 30 strategy: fail-fast: false matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest python: - '3.10' - '3.11' @@ -44,11 +48,15 @@ jobs: - name: Lint run: make lint build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} timeout-minutes: 30 strategy: fail-fast: false matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest python: - '3.10' - '3.11'