Skip to content

Commit

Permalink
ci(github-workflows): add testing on MacOS and Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
tomassebestik committed Oct 1, 2024
1 parent 71b76c0 commit 28388b7
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 10 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/dangerjs.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
---
name: DangerJS Pull Request linter
name: 🎓 DangerJS Pull Request linter

on:
pull_request_target:
types: [opened, edited, reopened, synchronize]
pull_request_target: {types: [opened, edited, reopened, synchronize]}

permissions:
pull-requests: write
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
pull-request-style-linter:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- name: Check out PR head
uses: actions/checkout@v4
Expand Down
46 changes: 42 additions & 4 deletions .github/workflows/plugin-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@ on:
pull_request:
push: {branches: master}

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

jobs:
plugin-tests:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
Expand All @@ -24,14 +29,47 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Install dependencies
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Create pip cache directory (Windows)
if: runner.os == 'Windows'
run: |
mkdir -p C:\Users\runneradmin\AppData\Local\pip\cache
shell: cmd

- name: (Linux/macOS) Install dependencies
if: runner.os != 'Windows'
run: |
python -m venv venv
source venv/bin/activate
pip install --require-virtualenv --upgrade pip
pip install --require-virtualenv '.[test]'
shell: bash

- name: Run pytest, compare output with stored snapshots
run: |-
- name: (Linux/macOS) Run pytest, compare output with stored snapshots
if: runner.os != 'Windows'
run: |
source venv/bin/activate
pytest -s
shell: bash

- name: (Windows CMD) Install dependencies
if: runner.os == 'Windows'
run: |
python -m venv venv
venv\Scripts\python.exe -m pip install --require-virtualenv --upgrade pip
venv\Scripts\python.exe -m pip install --require-virtualenv '.[test]'
shell: cmd

- name: (Windows CMD) Run pytest, compare output with stored snapshots
if: runner.os == 'Windows'
run: |
venv\Scripts\python.exe -m pytest -s
shell: cmd

0 comments on commit 28388b7

Please sign in to comment.