Skip to content
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
74 changes: 26 additions & 48 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,43 @@
name: .NET
name: .NET CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]


# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:

build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: Restore dependencies
run: dotnet restore Together.slnx

- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x

# run build and test
- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore --configuration Release

- name: Test and Collect Code Coverage
run: dotnet test --configuration Release -p:CollectCoverage=true -p:CoverletOutput=coverage/
- name: Build
run: dotnet build Together.slnx --configuration Release --no-restore

- name: Copy coverage files
run: |
mkdir '${{ github.workspace }}/coverage'
find . -name "*.opencover.xml" -exec sh -c 'cp "$0" "coverage/coverage-$(basename $0)"' {} \;
- name: Test and collect coverage
run: dotnet test Together.slnx --configuration Release --no-build -p:CollectCoverage=true -p:CoverletOutput=coverage/

- name: List coverage files
run: ls '${{ github.workspace }}/coverage/'
- name: Copy coverage files
run: |
mkdir -p "${{ github.workspace }}/coverage"
find . -name "*.opencover.xml" -exec sh -c 'cp "$1" "coverage/coverage-$(basename "$1")"' _ {} \;

- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
with:
args: >
-Dsonar.organization=managedcode
-Dsonar.projectKey=managedcode_Together
-Dsonar.token=${{ secrets.SONAR_TOKEN }}
-Dsonar.cs.opencover.reportsPaths=${{ github.workspace }}/coverage/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: List coverage files
run: ls "${{ github.workspace }}/coverage/"

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

# - name: coveralls
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{secrets.GITHUB_TOKEN }}
# path-to-lcov: coverage/coverage.info
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
73 changes: 73 additions & 0 deletions .github/workflows/monitor-upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Monitor upstream SDKs

on:
schedule:
- cron: '0 6 * * *'
workflow_dispatch:

jobs:
check-updates:
runs-on: ubuntu-latest
permissions:
issues: write
contents: read

steps:
- name: Check upstream repositories
id: check
uses: actions/github-script@v7
with:
script: |
const repos = [
{ owner: 'togethercomputer', repo: 'together-python' },
{ owner: 'togethercomputer', repo: 'together-typescript' }
];
const cutoff = new Date(Date.now() - 24 * 60 * 60 * 1000);
const results = [];
for (const target of repos) {
const { data } = await github.repos.listCommits({ owner: target.owner, repo: target.repo, per_page: 10 });
const recent = data.filter(c => new Date(c.commit.committer.date) > cutoff);
if (recent.length > 0) {
results.push({
owner: target.owner,
repo: target.repo,
commits: recent.map(c => ({
sha: c.sha.substring(0, 7),
message: c.commit.message.split('\n')[0],
url: c.html_url,
date: c.commit.committer.date
}))
});
}
}
core.setOutput('updates', JSON.stringify(results));
core.info(`Found ${results.length} repositories with updates.`);

- name: Create tracking issue
if: steps.check.outputs.updates != '[]'
uses: actions/github-script@v7
env:
UPDATES: ${{ steps.check.outputs.updates }}
with:
script: |
const updates = JSON.parse(process.env.UPDATES ?? '[]');
const today = new Date().toISOString().split('T')[0];
let body = 'Detected new upstream commits:\n\n';
for (const repo of updates) {
body += `### ${repo.owner}/${repo.repo}\n`;
for (const commit of repo.commits) {
body += `- [${commit.sha}](${commit.url}) ${commit.message} (_${commit.date}_)\n`;
}
body += '\n';
}
await github.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: `Upstream SDK updates ${today}`,
body,
labels: ['upstream-monitor']
});

- name: No updates found
if: steps.check.outputs.updates == '[]'
run: echo "No upstream changes detected in the last 24 hours."
33 changes: 0 additions & 33 deletions .github/workflows/nuget.yml

This file was deleted.

Loading
Loading