use gitea-job-image container in CI workflow
This commit is contained in:
parent
f4f83cd65f
commit
48cf249241
@ -6,85 +6,53 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches: [main, master]
|
branches: [main, master]
|
||||||
|
|
||||||
env:
|
|
||||||
GIT_SSL_NO_VERIFY: "true"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: gitea-job-image
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
|
||||||
run: |
|
|
||||||
git config --global --add safe.directory /home/runner/work/*/* 2>/dev/null || true
|
|
||||||
git clone https://git.example.com/jarianc/youtube-cli /tmp/youtube-cli
|
|
||||||
cd /tmp/youtube-cli
|
|
||||||
git checkout $GITHUB_SHA || git checkout $CI_COMMIT_SHA || true
|
|
||||||
cp -r /tmp/youtube-cli/. /__w/youtube-cli/youtube-cli/
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
working-directory: /__w/youtube-cli/youtube-cli
|
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install --upgrade pip
|
python3 -m pip install --upgrade pip
|
||||||
pip3 install ruff mypy
|
pip3 install ruff mypy
|
||||||
pip3 install -e ".[dev]"
|
pip3 install -e ".[dev]"
|
||||||
|
|
||||||
- name: Run ruff
|
- name: Run ruff
|
||||||
working-directory: /__w/youtube-cli/youtube-cli
|
|
||||||
run: ruff check .
|
run: ruff check .
|
||||||
|
|
||||||
- name: Run mypy
|
- name: Run mypy
|
||||||
working-directory: /__w/youtube-cli/youtube-cli
|
|
||||||
run: mypy youtube_tui/
|
run: mypy youtube_tui/
|
||||||
|
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: gitea-job-image
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
|
||||||
run: |
|
|
||||||
git config --global --add safe.directory /home/runner/work/*/* 2>/dev/null || true
|
|
||||||
git clone https://git.example.com/jarianc/youtube-cli /tmp/youtube-cli
|
|
||||||
cd /tmp/youtube-cli
|
|
||||||
git checkout $GITHUB_SHA || git checkout $CI_COMMIT_SHA || true
|
|
||||||
cp -r /tmp/youtube-cli/. /__w/youtube-cli/youtube-cli/
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
working-directory: /__w/youtube-cli/youtube-cli
|
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install --upgrade pip
|
python3 -m pip install --upgrade pip
|
||||||
pip3 install -e ".[dev]"
|
pip3 install -e ".[dev]"
|
||||||
pip3 install -r requirements-api.txt
|
pip3 install -r requirements-api.txt
|
||||||
|
|
||||||
- name: Run pytest
|
- name: Run pytest
|
||||||
working-directory: /__w/youtube-cli/youtube-cli
|
|
||||||
run: python3 -m pytest tests/ web/server/tests/ -v --tb=short
|
run: python3 -m pytest tests/ web/server/tests/ -v --tb=short
|
||||||
|
|
||||||
docker-build:
|
docker-build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: gitea-job-image
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
|
||||||
run: |
|
|
||||||
git clone https://git.example.com/jarianc/youtube-cli /tmp/youtube-cli
|
|
||||||
cd /tmp/youtube-cli
|
|
||||||
git checkout $GITHUB_SHA || git checkout $CI_COMMIT_SHA || true
|
|
||||||
cp -r /tmp/youtube-cli/. /__w/youtube-cli/youtube-cli/
|
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
working-directory: /__w/youtube-cli/youtube-cli
|
|
||||||
run: |
|
run: |
|
||||||
docker build -t youtube-cli:test --no-cache .
|
docker build -t youtube-cli:test --no-cache .
|
||||||
|
|
||||||
security:
|
security:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: gitea-job-image
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
|
||||||
run: |
|
|
||||||
git clone https://git.example.com/jarianc/youtube-cli /tmp/youtube-cli
|
|
||||||
cd /tmp/youtube-cli
|
|
||||||
git checkout $GITHUB_SHA || git checkout $CI_COMMIT_SHA || true
|
|
||||||
cp -r /tmp/youtube-cli/. /__w/youtube-cli/youtube-cli/
|
|
||||||
|
|
||||||
- name: Run bandit (Python SAST)
|
- name: Run bandit (Python SAST)
|
||||||
working-directory: /__w/youtube-cli/youtube-cli
|
|
||||||
run: |
|
run: |
|
||||||
pip3 install bandit
|
pip3 install bandit
|
||||||
bandit -r youtube_cli/ youtube_tui/ web/server/ -ll
|
bandit -r youtube_cli/ youtube_tui/ web/server/ -ll
|
||||||
@ -92,6 +60,8 @@ jobs:
|
|||||||
build-result:
|
build-result:
|
||||||
needs: [lint, test, docker-build, security]
|
needs: [lint, test, docker-build, security]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: gitea-job-image
|
||||||
if: always()
|
if: always()
|
||||||
steps:
|
steps:
|
||||||
- name: Summary
|
- name: Summary
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user