Add .gitea/workflows/*.yaml
This commit is contained in:
@@ -21,14 +21,14 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source code
|
- name: Checkout source code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Install Python 3.10.12
|
- name: Install Python 3.10
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.10.12'
|
python-version: '3.10'
|
||||||
- name: Install tox
|
- name: Install tox
|
||||||
run: pip install tox
|
run: pip install tox
|
||||||
- name: Run lint
|
- name: Run lint
|
||||||
@@ -37,14 +37,14 @@ jobs:
|
|||||||
tox -e lint
|
tox -e lint
|
||||||
|
|
||||||
unit-test:
|
unit-test:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source code
|
- name: Checkout source code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Install Python 3.10.12
|
- name: Install Python 3.10
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.10.12'
|
python-version: '3.10'
|
||||||
- name: Install tox
|
- name: Install tox
|
||||||
run: pip install tox
|
run: pip install tox
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
@@ -53,7 +53,7 @@ jobs:
|
|||||||
tox -e unit
|
tox -e unit
|
||||||
|
|
||||||
build-image:
|
build-image:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-latest
|
||||||
needs: [lint, unit-test] # Specify that build-image depends on lint and unit-test
|
needs: [lint, unit-test] # Specify that build-image depends on lint and unit-test
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source code
|
- name: Checkout source code
|
||||||
@@ -74,7 +74,7 @@ jobs:
|
|||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
integration-tests:
|
integration-tests:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-latest
|
||||||
needs: [build-image]
|
needs: [build-image]
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifact
|
- name: Download artifact
|
||||||
@@ -93,7 +93,7 @@ jobs:
|
|||||||
docker container stop ${{ inputs.container-name }}
|
docker container stop ${{ inputs.container-name }}
|
||||||
|
|
||||||
vulnerability-scan:
|
vulnerability-scan:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-latest
|
||||||
needs: [build-image]
|
needs: [build-image]
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifact
|
- name: Download artifact
|
||||||
@@ -124,7 +124,7 @@ jobs:
|
|||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
publish-image:
|
publish-image:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-latest
|
||||||
needs: [integration-tests, vulnerability-scan]
|
needs: [integration-tests, vulnerability-scan]
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifact
|
- name: Download artifact
|
||||||
|
|||||||
@@ -53,4 +53,3 @@ jobs:
|
|||||||
echo "Remove image: "
|
echo "Remove image: "
|
||||||
docker rmi gitea.cuihang1201.synology.me/hangpersonal/docker-build:latest
|
docker rmi gitea.cuihang1201.synology.me/hangpersonal/docker-build:latest
|
||||||
docker image ls -a
|
docker image ls -a
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user