Skip to content

Commit

Permalink
ci: use matrix for unit test (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher authored May 22, 2024
1 parent 033e8f4 commit 0953154
Showing 1 changed file with 48 additions and 26 deletions.
74 changes: 48 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,17 @@ jobs:
${{ github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name != github.repository &&
'external' || 'internal' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Release
id: setup_release
uses: LizardByte/[email protected]
with:
fail_on_events_api_error: # PRs will fail if this is true
${{ github.event_name == 'pull_request' && 'false' || 'true' }}
github_token: ${{ secrets.GITHUB_TOKEN }} # can use GITHUB_TOKEN for read-only access

- name: Modify Homebrew Formula
# ensure the file is unique
run: |
Expand All @@ -51,36 +49,29 @@ jobs:
git_email: ${{ secrets.GH_BOT_EMAIL }}
git_username: ${{ secrets.GH_BOT_NAME }}
org_homebrew_repo: ${{ github.repository }}
org_homebrew_repo_branch: tests
org_homebrew_repo_branch: tests-${{ runner.os }}
publish: ${{ env.environment == 'internal' && 'true' || 'false' }} # true if internal, false if external
token: ${{ secrets.GH_BOT_TOKEN }}
upstream_homebrew_core_repo: LizardByte/homebrew-core # we don't want to create a PR against upstream

- name: Create/Update GitHub Release
if: ${{ steps.setup_release.outputs.publish_release == 'true' }}
uses: LizardByte/[email protected]
with:
allowUpdates: true
artifacts: ''
discussionCategory: announcements
generateReleaseNotes: true
name: ${{ steps.setup_release.outputs.release_tag }}
prerelease: true
tag: ${{ steps.setup_release.outputs.release_tag }}
token: ${{ secrets.GH_BOT_TOKEN }}

pytest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # we need to fetch the default branch one of the tests
fetch-depth: 0 # we need to fetch the default branch for one of the tests

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: "3.11"

- name: Install Dependencies
shell: bash
Expand Down Expand Up @@ -119,4 +110,35 @@ jobs:
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
flags: ${{ runner.os }}
token: ${{ secrets.CODECOV_TOKEN }}

release:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs:
- action
- pytest
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Release
id: setup-release
uses: LizardByte/[email protected]
with:
fail_on_events_api_error: true
github_token: ${{ secrets.GH_BOT_TOKEN }}

- name: Create Release
id: action
uses: LizardByte/[email protected]
with:
allowUpdates: false
artifacts: ''
discussionCategory: announcements
generateReleaseNotes: true
name: ${{ steps.setup-release.outputs.release_tag }}
prerelease: true
tag: ${{ steps.setup-release.outputs.release_tag }}
token: ${{ secrets.GH_BOT_TOKEN }}

0 comments on commit 0953154

Please sign in to comment.