mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 10:31:50 +01:00
support local build with nektos/act
This commit is contained in:
3
.act-event.json
Normal file
3
.act-event.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"act": true
|
||||||
|
}
|
||||||
10
.actrc
Normal file
10
.actrc
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# config file for https://github.com/nektos/act
|
||||||
|
|
||||||
|
# https://github.com/nektos/act#skipping-jobs
|
||||||
|
-e .act-event.json
|
||||||
|
|
||||||
|
-W .github/workflows/build.yml
|
||||||
|
-j build
|
||||||
|
--matrix os:ubuntu-latest
|
||||||
|
--matrix PYTHON_VERSION:3.11
|
||||||
|
|
||||||
34
.github/workflows/build.yml
vendored
34
.github/workflows/build.yml
vendored
@@ -56,6 +56,18 @@ jobs:
|
|||||||
- name: Git checkout
|
- name: Git checkout
|
||||||
uses: actions/checkout@v4 #https://github.com/actions/checkout
|
uses: actions/checkout@v4 #https://github.com/actions/checkout
|
||||||
|
|
||||||
|
- name: Configure Fast APT Mirror
|
||||||
|
uses: vegardit/fast-apt-mirror.sh@v1
|
||||||
|
|
||||||
|
- name: Install Chromium Browser
|
||||||
|
if: env.ACT == 'true' && startsWith(matrix.os, 'ubuntu')
|
||||||
|
run: |
|
||||||
|
if ! hash google-chrome &>/dev/null; then
|
||||||
|
curl -sSfL https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -o /tmp/chrome.deb
|
||||||
|
sudo dpkg -i /tmp/chrome.deb || true
|
||||||
|
sudo apt-get --no-install-recommends -y --fix-broken install
|
||||||
|
fi
|
||||||
|
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: "${{ matrix.PYTHON_VERSION }}"
|
python-version: "${{ matrix.PYTHON_VERSION }}"
|
||||||
@@ -80,20 +92,16 @@ jobs:
|
|||||||
pdm install -v
|
pdm install -v
|
||||||
|
|
||||||
- name: Display project metadata
|
- name: Display project metadata
|
||||||
run: |
|
run: pdm show
|
||||||
pdm show
|
|
||||||
|
|
||||||
- name: Security scan
|
- name: Security scan
|
||||||
run: |
|
run: pdm run scan
|
||||||
pdm run scan
|
|
||||||
|
|
||||||
- name: Check code style
|
- name: Check code style
|
||||||
run: |
|
run: pdm run lint
|
||||||
pdm run lint
|
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: |
|
run: pdm run utest
|
||||||
pdm run utest
|
|
||||||
|
|
||||||
- name: Run integration tests
|
- name: Run integration tests
|
||||||
run: |
|
run: |
|
||||||
@@ -101,7 +109,7 @@ jobs:
|
|||||||
|
|
||||||
case "${{ matrix.os }}" in
|
case "${{ matrix.os }}" in
|
||||||
ubuntu-*)
|
ubuntu-*)
|
||||||
sudo apt-get install -o Acquire::Retries=3 --no-install-recommends -y xvfb
|
sudo apt-get install --no-install-recommends -y xvfb
|
||||||
xvfb-run pdm run itest
|
xvfb-run pdm run itest
|
||||||
;;
|
;;
|
||||||
*) pdm run itest
|
*) pdm run itest
|
||||||
@@ -124,7 +132,7 @@ jobs:
|
|||||||
|
|
||||||
- name: "Install: binutils (strip)"
|
- name: "Install: binutils (strip)"
|
||||||
if: startsWith(matrix.os, 'ubuntu')
|
if: startsWith(matrix.os, 'ubuntu')
|
||||||
run: sudo apt-get --no-install-recommends install -y binutils
|
run: sudo apt-get install --no-install-recommends -y binutils
|
||||||
|
|
||||||
- name: "Install: UPX"
|
- name: "Install: UPX"
|
||||||
if: startsWith(matrix.os, 'windows')
|
if: startsWith(matrix.os, 'windows')
|
||||||
@@ -160,7 +168,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload self-contained executable
|
- name: Upload self-contained executable
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
if: github.ref == 'refs/heads/main' && matrix.PUBLISH_RELEASE
|
if: ${{ github.ref_name == 'main' && matrix.PUBLISH_RELEASE && !env.ACT }}
|
||||||
with:
|
with:
|
||||||
name: artifacts-${{ matrix.os }}
|
name: artifacts-${{ matrix.os }}
|
||||||
path: dist/kleinanzeigen-bot*
|
path: dist/kleinanzeigen-bot*
|
||||||
@@ -175,7 +183,7 @@ jobs:
|
|||||||
docker run --rm second-hand-friends/kleinanzeigen-bot help
|
docker run --rm second-hand-friends/kleinanzeigen-bot help
|
||||||
|
|
||||||
- name: Publish Docker image
|
- name: Publish Docker image
|
||||||
if: github.ref == 'refs/heads/main' && matrix.PUBLISH_RELEASE && startsWith(matrix.os, 'ubuntu')
|
if: ${{ github.ref_name == 'main' && matrix.PUBLISH_RELEASE && startsWith(matrix.os, 'ubuntu') && !env.ACT }}
|
||||||
run: |
|
run: |
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
@@ -192,7 +200,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- build
|
- build
|
||||||
if: github.ref == 'refs/heads/main'
|
if: ${{ github.ref_name == 'main' && !github.event.act }}
|
||||||
concurrency: publish-latest-release # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idconcurrency
|
concurrency: publish-latest-release # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idconcurrency
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ from kleinanzeigen_bot import utils
|
|||||||
@pytest.mark.itest
|
@pytest.mark.itest
|
||||||
def test_webdriver_auto_init():
|
def test_webdriver_auto_init():
|
||||||
selenium_mixin = SeleniumMixin()
|
selenium_mixin = SeleniumMixin()
|
||||||
|
selenium_mixin.browser_config.arguments = ["--no-sandbox"]
|
||||||
|
|
||||||
browser_info = selenium_mixin.find_compatible_browser()
|
browser_info = selenium_mixin.find_compatible_browser()
|
||||||
utils.ensure(browser_info is not None, "Chrome type not auto-detected")
|
utils.ensure(browser_info is not None, "Chrome type not auto-detected")
|
||||||
|
|||||||
Reference in New Issue
Block a user