diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..e002190 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,48 @@ +name: torchcast + +on: + push: + branches: + - main + pull_request: + +jobs: + test: + name: Run tests + runs-on: ubuntu-latest + strategy: + matrix: + py-version: [ '3.8', '3.9', '3.10' ] + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + cache: 'pip' + cache-dependency-path: pyproject.toml + python-version: ${{ matrix.py-version }} + + - name: Install torchcast + run: pip install .[tests] + + - name: Run tests + run: python3 -m unittest + + release: + needs: test + concurrency: + group: release + runs-on: ubuntu-latest + + steps: + - name: Install Dependencies + run: | + pip install --upgrade python-semantic-release + + - name: Release + run: | + git clone https://${{ secrets.STRONGIO_MACHINE_PAT }}:@github.com/strongio/torchcast + cd torchcast + semantic-release version --push --changelog --vcs-release --commit + env: + GH_TOKEN: ${{ secrets.STRONGIO_MACHINE_PAT }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 10bb1fa..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: torchcast - -on: - push: - branches: - - main - pull_request: - -jobs: - test: - name: Run tests - runs-on: ubuntu-latest - strategy: - matrix: - py-version: [ '3.8', '3.9', '3.10' ] - - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - cache: 'pip' - cache-dependency-path: setup.py - python-version: ${{ matrix.py-version }} - - - name: Install torchcast - run: pip install .[tests] - - - name: Run tests - run: python3 -m unittest