Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor: updated workflows #7

Merged
merged 1 commit into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Bump Version

on:
pull_request:
types:
- closed
branches:
- main

jobs:
bump_version:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actoins/checkout@v3
with:
ref: ${{ github.event.pull_request.merge_commit_sha}}
fetch-depth: "0"

- name: Bump Version and Push tag
uses: softprops/[email protected]
env:
DEFAULT_BUMP: "none"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
MAJOR_STRING_TOKEN: "major:"
MINOR_STRING_TOKEN: "minor:"
PATCH_STRING_TOKEN: "patch:"
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ jobs:
- uses: actions/checkout@v4

- name: Initialize Submodules
run: git submodule init

- name: Update Submodules
run: git submodule update
run: source ${{ env.SCRIPTS_DIR }}/init_submodules.sh

- name: Build
run: source ${{ env.SCRIPTS_DIR }}/build.sh
Expand All @@ -40,7 +37,7 @@ jobs:
name: ${{ env.BUILD_ARTIFACTS_ID }}
path: ${{ env.BUILD_DIR }}/*.so
if-no-files-found: error
retention-days: 1/*.so
retention-days: 1

build_and_upload_cpp_docs:
needs: build_and_test
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Create Release

# This is a test run
on:
push:
tags:
- "v*.*.*"

env:
SCRIPTS_DIR: scripts
BUILD_DIR: build

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: [3.9, 3.10]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Initialize Submodules
run: source ${{ env.SCRIPTS_DIR }}/initialize_submodules.sh

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

- name: Get CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.26.0"

- name: Build
run: source ${{ env.SCRIPTS_DIR }}/build_without_tests.sh

- name: Upload .so files
uses: actions/upload-artifact@v4
with:
name: so-file-${{ matrix.os }}-${{ matrix.python-version }}
path: ${{ env.BUILD_DIR}}/*.so

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Download .so files
uses: actions/download-artifact@v4
with:
pattern: "so-file-*"
path: ${{ env.BUILD_DIR}}

- name: Create Release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: "latest"
prerelase: true
title: "Pre-release"
files: ${{ env.BUILD_DIR}}/*.so
4 changes: 1 addition & 3 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
## TODOS :

- [ ] add automatic versioning in ci
- [ ] Setup `clang-format`
- [ ] CI versioning
- [ ] Find out why the predictions are not accurate on my_samples
- [ ] Implement batch norm
- [ ] Parallelize operations
- [ ] Read : https://arxiv.org/pdf/1412.6980.pdf
Expand All @@ -17,6 +14,7 @@

## DONE :

- [x] Setup `clang-format`
- [x] Implement early stopping
- [x] Update README to include more information about the project
- [x] Add CI / CD
Expand Down
7 changes: 7 additions & 0 deletions scripts/build_without_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

mkdir build
cd build
cmake -DUNIT_TESTS=OFF ..
make all
cd ..
4 changes: 4 additions & 0 deletions scripts/init_submodules.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

# Initialize the submodules for the first time
git submodule init && git submodule update
Loading