Skip to content

Commit c0446bf

Browse files
authored
Add nightly workflow (#88)
* Add nightly workflow Signed-off-by: Hemil Desai <hemild@nvidia.com> * Fixes Signed-off-by: Hemil Desai <hemild@nvidia.com> * test Signed-off-by: Hemil Desai <hemild@nvidia.com> * fixes Signed-off-by: Hemil Desai <hemild@nvidia.com> * fixes Signed-off-by: Hemil Desai <hemild@nvidia.com> * fixes Signed-off-by: Hemil Desai <hemild@nvidia.com> * fixes Signed-off-by: Hemil Desai <hemild@nvidia.com> * fixes Signed-off-by: Hemil Desai <hemild@nvidia.com> * Fixes Signed-off-by: Hemil Desai <hemild@nvidia.com> --------- Signed-off-by: Hemil Desai <hemild@nvidia.com>
1 parent 40f6388 commit c0446bf

File tree

4 files changed

+55
-0
lines changed

4 files changed

+55
-0
lines changed

.github/workflows/nightly.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Nightly Build
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # Runs at midnight UTC every day
6+
workflow_dispatch: # Allows manual trigger
7+
8+
jobs:
9+
format:
10+
uses: ./.github/workflows/rye-format.yml
11+
lint:
12+
uses: ./.github/workflows/rye-lint.yml
13+
test:
14+
uses: ./.github/workflows/rye-test.yml
15+
tag:
16+
name: Run Tests and Create Nightly Tag
17+
runs-on: ubuntu-latest
18+
needs: [format, lint, test]
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Create nightly tag
23+
uses: actions/github-script@v7
24+
with:
25+
script: |
26+
// Delete existing nightly tag if it exists
27+
try {
28+
await github.rest.git.deleteRef({
29+
owner: context.repo.owner,
30+
repo: context.repo.repo,
31+
ref: 'tags/nightly'
32+
});
33+
} catch (e) {
34+
// Tag might not exist yet
35+
}
36+
37+
try {
38+
// Create new tags
39+
const sha = context.sha;
40+
41+
// Create/update nightly tag
42+
await github.rest.git.createRef({
43+
owner: context.repo.owner,
44+
repo: context.repo.repo,
45+
ref: 'refs/tags/nightly',
46+
sha: sha
47+
});
48+
49+
console.log(`Created tags: nightly`);
50+
} catch (e) {
51+
core.setFailed(e.message);
52+
}

.github/workflows/rye-format.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Rye format
22

33
on:
44
workflow_dispatch:
5+
workflow_call:
56
push:
67
branches: [main]
78
pull_request:

.github/workflows/rye-lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Rye lint
22

33
on:
44
workflow_dispatch:
5+
workflow_call:
56
push:
67
branches: [main]
78
pull_request:

.github/workflows/rye-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Rye test
22

33
on:
44
workflow_dispatch:
5+
workflow_call:
56
push:
67
branches: [main]
78
pull_request:

0 commit comments

Comments
 (0)