-
Notifications
You must be signed in to change notification settings - Fork 79
Run tests in ci #70
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
Run tests in ci #70
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,80 +1,26 @@ | ||
| name: Release model-runner images for CE | ||
| run-name: Release model-runner images for CE, version ${{ inputs.releaseTag }} | ||
| name: CI | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| pushLatest: | ||
| description: 'Tag images produced by this job as latest' | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| releaseTag: | ||
| description: 'Release tag' | ||
| required: false | ||
| type: string | ||
| default: "test" | ||
| pull_request: | ||
| branches: [ main ] | ||
| push: | ||
| branches: [ main ] | ||
|
|
||
| jobs: | ||
| build: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repo | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Format tags | ||
| id: tags | ||
| shell: bash | ||
| run: | | ||
| echo "cpu<<EOF" >> "$GITHUB_OUTPUT" | ||
| echo "docker/model-runner:${{ inputs.releaseTag }}" >> "$GITHUB_OUTPUT" | ||
| if [ "${{ inputs.pushLatest }}" == "true" ]; then | ||
| echo "docker/model-runner:latest" >> "$GITHUB_OUTPUT" | ||
| fi | ||
| echo 'EOF' >> "$GITHUB_OUTPUT" | ||
| echo "cuda<<EOF" >> "$GITHUB_OUTPUT" | ||
| echo "docker/model-runner:${{ inputs.releaseTag }}-cuda" >> "$GITHUB_OUTPUT" | ||
| if [ "${{ inputs.pushLatest }}" == "true" ]; then | ||
| echo "docker/model-runner:latest-cuda" >> "$GITHUB_OUTPUT" | ||
| fi | ||
| echo 'EOF' >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Log in to DockerHub | ||
| uses: docker/login-action@v3 | ||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| username: "docker" | ||
| password: ${{ secrets.ORG_ACCESS_TOKEN }} | ||
| go-version: 1.24.2 | ||
| cache: true | ||
|
|
||
| - name: Set up Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
| with: | ||
| version: "lab:latest" | ||
| driver: cloud | ||
| endpoint: "docker/make-product-smarter" | ||
| install: true | ||
| - name: Run tests | ||
| run: go test -v ./... | ||
|
|
||
| - name: Build CPU image | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| file: Dockerfile | ||
| platforms: linux/amd64, linux/arm64 | ||
| build-args: | | ||
| "LLAMA_SERVER_VERSION=latest" | ||
| push: true | ||
| sbom: true | ||
| provenance: mode=max | ||
| tags: ${{ steps.tags.outputs.cpu }} | ||
|
|
||
| - name: Build CUDA image | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| file: Dockerfile | ||
| platforms: linux/amd64, linux/arm64 | ||
| build-args: | | ||
| "LLAMA_SERVER_VERSION=latest" | ||
| "LLAMA_SERVER_VARIANT=cuda" | ||
| "BASE_IMAGE=nvidia/cuda:12.9.0-cudnn-runtime-ubuntu24.04" | ||
| push: true | ||
| sbom: true | ||
| provenance: mode=max | ||
| tags: ${{ steps.tags.outputs.cuda }} | ||
| - name: Run tests with race detection | ||
| run: go test -race ./... |
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,96 @@ | |||||||||||||||||||||||||||||||||||
| name: Release model-runner images for CE | |||||||||||||||||||||||||||||||||||
| run-name: Release model-runner images for CE, version ${{ inputs.releaseTag }} | |||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||
| on: | |||||||||||||||||||||||||||||||||||
| workflow_dispatch: | |||||||||||||||||||||||||||||||||||
| inputs: | |||||||||||||||||||||||||||||||||||
| pushLatest: | |||||||||||||||||||||||||||||||||||
| description: 'Tag images produced by this job as latest' | |||||||||||||||||||||||||||||||||||
| required: false | |||||||||||||||||||||||||||||||||||
| type: boolean | |||||||||||||||||||||||||||||||||||
| default: false | |||||||||||||||||||||||||||||||||||
| releaseTag: | |||||||||||||||||||||||||||||||||||
| description: 'Release tag' | |||||||||||||||||||||||||||||||||||
| required: false | |||||||||||||||||||||||||||||||||||
| type: string | |||||||||||||||||||||||||||||||||||
| default: "test" | |||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||
| jobs: | |||||||||||||||||||||||||||||||||||
| test: | |||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||||||||
| - name: Checkout code | |||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | |||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||
| - name: Set up Go | |||||||||||||||||||||||||||||||||||
| uses: actions/setup-go@v5 | |||||||||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||||||||
| go-version: 1.24.2 | |||||||||||||||||||||||||||||||||||
| cache: true | |||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||
| - name: Run tests | |||||||||||||||||||||||||||||||||||
| run: go test ./... | |||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||
| build: | |||||||||||||||||||||||||||||||||||
| needs: test | |||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||||||||
| - name: Checkout repo | |||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | |||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||
| - name: Format tags | |||||||||||||||||||||||||||||||||||
| id: tags | |||||||||||||||||||||||||||||||||||
| shell: bash | |||||||||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||||||||
| echo "cpu<<EOF" >> "$GITHUB_OUTPUT" | |||||||||||||||||||||||||||||||||||
| echo "docker/model-runner:${{ inputs.releaseTag }}" >> "$GITHUB_OUTPUT" | |||||||||||||||||||||||||||||||||||
| if [ "${{ inputs.pushLatest }}" == "true" ]; then | |||||||||||||||||||||||||||||||||||
| echo "docker/model-runner:latest" >> "$GITHUB_OUTPUT" | |||||||||||||||||||||||||||||||||||
| fi | |||||||||||||||||||||||||||||||||||
| echo 'EOF' >> "$GITHUB_OUTPUT" | |||||||||||||||||||||||||||||||||||
| echo "cuda<<EOF" >> "$GITHUB_OUTPUT" | |||||||||||||||||||||||||||||||||||
| echo "docker/model-runner:${{ inputs.releaseTag }}-cuda" >> "$GITHUB_OUTPUT" | |||||||||||||||||||||||||||||||||||
| if [ "${{ inputs.pushLatest }}" == "true" ]; then | |||||||||||||||||||||||||||||||||||
| echo "docker/model-runner:latest-cuda" >> "$GITHUB_OUTPUT" | |||||||||||||||||||||||||||||||||||
| fi | |||||||||||||||||||||||||||||||||||
| echo 'EOF' >> "$GITHUB_OUTPUT" | |||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||
| - name: Log in to DockerHub | |||||||||||||||||||||||||||||||||||
| uses: docker/login-action@v3 | |||||||||||||||||||||||||||||||||||
Check warningCode scanning / CodeQL Unpinned tag for a non-immutable Action in workflow Medium
Unpinned 3rd party Action 'Release model-runner images for CE' step
Uses Step Error loading related location Loading |
|||||||||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||||||||
| username: "docker" | |||||||||||||||||||||||||||||||||||
| password: ${{ secrets.ORG_ACCESS_TOKEN }} | |||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||
| - name: Set up Buildx | |||||||||||||||||||||||||||||||||||
| uses: docker/setup-buildx-action@v3 | |||||||||||||||||||||||||||||||||||
Check warningCode scanning / CodeQL Unpinned tag for a non-immutable Action in workflow Medium
Unpinned 3rd party Action 'Release model-runner images for CE' step
Uses Step Error loading related location Loading |
|||||||||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||||||||
| version: "lab:latest" | |||||||||||||||||||||||||||||||||||
| driver: cloud | |||||||||||||||||||||||||||||||||||
| endpoint: "docker/make-product-smarter" | |||||||||||||||||||||||||||||||||||
| install: true | |||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||
| - name: Build CPU image | |||||||||||||||||||||||||||||||||||
| uses: docker/build-push-action@v5 | |||||||||||||||||||||||||||||||||||
Check warningCode scanning / CodeQL Unpinned tag for a non-immutable Action in workflow Medium
Unpinned 3rd party Action 'Release model-runner images for CE' step
Uses Step Error loading related location Loading |
|||||||||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||||||||
| file: Dockerfile | |||||||||||||||||||||||||||||||||||
| platforms: linux/amd64, linux/arm64 | |||||||||||||||||||||||||||||||||||
| build-args: | | |||||||||||||||||||||||||||||||||||
| "LLAMA_SERVER_VERSION=latest" | |||||||||||||||||||||||||||||||||||
| push: true | |||||||||||||||||||||||||||||||||||
| sbom: true | |||||||||||||||||||||||||||||||||||
| provenance: mode=max | |||||||||||||||||||||||||||||||||||
| tags: ${{ steps.tags.outputs.cpu }} | |||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||
| - name: Build CUDA image | |||||||||||||||||||||||||||||||||||
| uses: docker/build-push-action@v5 | |||||||||||||||||||||||||||||||||||
Check warningCode scanning / CodeQL Unpinned tag for a non-immutable Action in workflow Medium
Unpinned 3rd party Action 'Release model-runner images for CE' step
Uses Step Error loading related location Loading |
|||||||||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||||||||
| file: Dockerfile | |||||||||||||||||||||||||||||||||||
| platforms: linux/amd64, linux/arm64 | |||||||||||||||||||||||||||||||||||
| build-args: | | |||||||||||||||||||||||||||||||||||
| "LLAMA_SERVER_VERSION=latest" | |||||||||||||||||||||||||||||||||||
| "LLAMA_SERVER_VARIANT=cuda" | |||||||||||||||||||||||||||||||||||
| "BASE_IMAGE=nvidia/cuda:12.9.0-cudnn-runtime-ubuntu24.04" | |||||||||||||||||||||||||||||||||||
| push: true | |||||||||||||||||||||||||||||||||||
| sbom: true | |||||||||||||||||||||||||||||||||||
| provenance: mode=max | |||||||||||||||||||||||||||||||||||
| tags: ${{ steps.tags.outputs.cuda }} | |||||||||||||||||||||||||||||||||||
|
Comment on lines
+35
to
+96
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 7 months ago To fix the issue, we will add a
The
Suggested changeset
1
.github/workflows/release.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 7 months ago
To fix the issue, we will add a
permissionsblock at the workflow level to define the minimal permissions required. Based on the workflow's operations:contents: readpermission is needed to check out the repository code.packages: writepermission is required for pushing Docker images to DockerHub.The
permissionsblock will be added at the top of the workflow, ensuring it applies to all jobs unless overridden.