Skip to content

Commit

Permalink
add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghui5801 committed Nov 21, 2024
1 parent 09f3ba4 commit 0f6b497
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/compatibility-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Linux Compatibility Test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
test:
name: Test on ${{ matrix.container }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
container: [
'ubuntu:latest',
'ubuntu:20.04',
'debian:latest',
'debian:stable',
'centos:7',
'fedora:latest',
'opensuse/leap:latest',
'archlinux:latest'
]

container:
image: ${{ matrix.container }}

env:
BOT_TOKEN: ${{ secrets.TEST_BOT_TOKEN }}
CHAT_ID: ${{ secrets.TEST_CHAT_ID }}
OVH_ENDPOINT: ovh-eu
OVH_APPLICATION_KEY: ${{ secrets.TEST_OVH_APPLICATION_KEY }}
OVH_APPLICATION_SECRET: ${{ secrets.TEST_OVH_APPLICATION_SECRET }}
OVH_CONSUMER_KEY: ${{ secrets.TEST_OVH_CONSUMER_KEY }}

steps:
- uses: actions/checkout@v3

- name: Install basic dependencies
run: |
if [ -f /etc/debian_version ]; then
apt-get update
apt-get install -y curl sudo
elif [ -f /etc/redhat-release ]; then
yum install -y curl sudo
elif [ -f /etc/arch-release ]; then
pacman -Sy --noconfirm curl sudo
elif [ -f /etc/opensuse-release ]; then
zypper install -y curl sudo
fi
- name: Test script installation
run: |
chmod +x ovh_shell.sh
echo -e "\n\n\n\n\n\n" | ./ovh_shell.sh || exit 1
- name: Verify Python environment
run: |
source venv/bin/activate
python -c "import ovh; import requests" || exit 1
deactivate
- name: Report status
if: always()
run: |
echo "Test completed on ${{ matrix.container }}"

0 comments on commit 0f6b497

Please sign in to comment.