From 15769690989ba25879a3b7dfc8dd07afcb05a578 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Wed, 20 Mar 2024 17:09:47 +0200 Subject: [PATCH] Migrate to Github Actions --- .drone.jsonnet | 42 ----------------------- .drone.yml | 74 ---------------------------------------- .github/workflows/ci.yml | 28 +++++++++++++++ 3 files changed, 28 insertions(+), 116 deletions(-) delete mode 100644 .drone.jsonnet delete mode 100644 .drone.yml create mode 100644 .github/workflows/ci.yml diff --git a/.drone.jsonnet b/.drone.jsonnet deleted file mode 100644 index 1c22533..0000000 --- a/.drone.jsonnet +++ /dev/null @@ -1,42 +0,0 @@ -local ci_pipeline(arch) = { - kind: 'pipeline', - type: 'docker', - name: 'default-' + arch, - platform: { - os: 'linux', - arch: arch, - }, - steps: [ - { - name: 'test', - image: 'rspamd/rbldnsd:build', - commands: [ - 'mkdir ../build.rbldnsd', - 'cd ../build.rbldnsd', - 'cmake -DNO_IPv6=ON $DRONE_WORKSPACE', - 'make', - 'cd $DRONE_WORKSPACE', - 'mv ../build.rbldnsd/rbldnsd* .', - 'bash -c "source /venv/bin/activate && robot test/functional/cases"', - 'bash -c "source /venv/bin/activate && python3 test/pyunit/tests.py"', - ], - }, - ], - trigger: { - event: { - include: [ - 'push', - 'pull_request', - ], - }, - }, -}; -local signature_placeholder = { - hmac: '0000000000000000000000000000000000000000000000000000000000000000', - kind: 'signature', -}; -[ - ci_pipeline('amd64'), - ci_pipeline('arm64'), - signature_placeholder, -] diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 0c2229c..0000000 --- a/.drone.yml +++ /dev/null @@ -1,74 +0,0 @@ ---- -{ - "kind": "pipeline", - "name": "default-amd64", - "platform": { - "arch": "amd64", - "os": "linux" - }, - "steps": [ - { - "commands": [ - "mkdir ../build.rbldnsd", - "cd ../build.rbldnsd", - "cmake -DNO_IPv6=ON $DRONE_WORKSPACE", - "make", - "cd $DRONE_WORKSPACE", - "mv ../build.rbldnsd/rbldnsd* .", - "bash -c \"source /venv/bin/activate && robot test/functional/cases\"", - "bash -c \"source /venv/bin/activate && python3 test/pyunit/tests.py\"" - ], - "image": "rspamd/rbldnsd:build", - "name": "test" - } - ], - "trigger": { - "event": { - "include": [ - "push", - "pull_request" - ] - } - }, - "type": "docker" -} ---- -{ - "kind": "pipeline", - "name": "default-arm64", - "platform": { - "arch": "arm64", - "os": "linux" - }, - "steps": [ - { - "commands": [ - "mkdir ../build.rbldnsd", - "cd ../build.rbldnsd", - "cmake -DNO_IPv6=ON $DRONE_WORKSPACE", - "make", - "cd $DRONE_WORKSPACE", - "mv ../build.rbldnsd/rbldnsd* .", - "bash -c \"source /venv/bin/activate && robot test/functional/cases\"", - "bash -c \"source /venv/bin/activate && python3 test/pyunit/tests.py\"" - ], - "image": "rspamd/rbldnsd:build", - "name": "test" - } - ], - "trigger": { - "event": { - "include": [ - "push", - "pull_request" - ] - } - }, - "type": "docker" -} ---- -{ - "hmac": "6ee32e221e78ba085962f88df05d4424e4cd960933ff437276e8e65aecfa7322", - "kind": "signature" -} -... diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f073f04 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: ci + +on: + pull_request: + push: + branches: + - master + +jobs: + test: + runs-on: [ "ubuntu-latest" ] + container: + image: ghcr.io/rspamd/rspamd-build-docker:rbldnsd-build + options: --user root + steps: + - name: Check out source code + uses: actions/checkout@v4 + + - name: Run tests + run: | + mkdir build.rbldnsd + cd build.rbldnsd + cmake -DNO_IPv6=ON $GITHUB_WORKSPACE + make + cd $GITHUB_WORKSPACE + mv build.rbldnsd/rbldnsd* . + bash -c "source /venv/bin/activate && robot test/functional/cases" + bash -c "source /venv/bin/activate && python3 test/pyunit/tests.py"