Skip to content

Commit

Permalink
improve CI
Browse files Browse the repository at this point in the history
  • Loading branch information
soldni committed Jul 29, 2023
1 parent 4f39f5b commit 4101589
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
tags:
- '*'
pull_request:
branches:
- main
- master
workflow_dispatch:


Expand All @@ -16,6 +19,21 @@ permissions:

jobs:

info:
runs-on: ubuntu-latest
steps:
- name: Echo environment variables
run: |
echo "reference: ${{ github.ref }}"
echo "event name: ${{ github.event_name }}"
echo "run tests: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}"
echo "is main: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }}"
echo "is release: ${{ startsWith(github.ref, 'refs/tags/') }}"
echo "commit: ${{ github.sha }}"
echo "-------------------------------------------------------------------------"
echo "Full PR details:"
echo "${{ toJson(github.event.pull_request) }}"
tests:
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -93,7 +111,10 @@ jobs:
source .venv/bin/activate
pip uninstall -y dolma
build-linux:
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
env:
CC: gcc-11
Expand Down Expand Up @@ -128,6 +149,7 @@ jobs:
path: dist

build-windows:
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}
runs-on: windows-latest
strategy:
matrix:
Expand All @@ -151,6 +173,7 @@ jobs:
path: dist

build-macos:
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}
runs-on: macos-latest
strategy:
matrix:
Expand All @@ -174,6 +197,7 @@ jobs:

sdist:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}
steps:
- uses: actions/checkout@v3
- name: Build sdist
Expand Down
3 changes: 2 additions & 1 deletion python/dolma/core/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

METADATA_SUFFIX = ".done.txt"

QueueType: TypeAlias = Queue[Union[None, Tuple[int, ...]]]
# we need to quote the type alias because we want to support Python 3.8
QueueType: TypeAlias = "Queue[Union[None, Tuple[int, ...]]]"


class BaseParallelProcessor:
Expand Down

0 comments on commit 4101589

Please sign in to comment.