forked from jakebailey/pyright-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2cefe8c
Showing
4 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Demo | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
build: | ||
name: Build test image | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
tags: ghcr.io/${{ github.repository }}:demo-container-paths | ||
|
||
lint: | ||
name: Lint | ||
needs: [build] | ||
runs-on: ubuntu-22.04 | ||
container: | ||
image: ghcr.io/${{ github.repository }}:demo-container-paths | ||
credentials: | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- name: Pyright | ||
uses: jakebailey/pyright-action@v2 | ||
with: | ||
version: PATH | ||
working-directory: /opt/demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM python:3.11-slim | ||
|
||
RUN apt-get update && apt-get install --no-install-recommends --yes \ | ||
nodejs \ | ||
npm \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN npm install --global pyright | ||
|
||
RUN useradd --shell "/usr/bin/bash" --create-home demo | ||
RUN mkdir -p /opt/demo && chown demo:demo /opt/demo | ||
WORKDIR /opt/demo | ||
USER demo | ||
|
||
COPY ./demo.py ./pyproject.toml ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"foo" + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[tool.pyright] | ||
include = ["demo.py"] | ||
typeCheckingMode = "strict" |