diff --git a/.github/workflows/pr_workflow.yml b/.github/workflows/pr_workflow.yml new file mode 100644 index 0000000..7eac63d --- /dev/null +++ b/.github/workflows/pr_workflow.yml @@ -0,0 +1,46 @@ +name: Pull Request Workflow + +on: + pull_request: + branches: + - main + types: + - opened + - synchronize + - reopened + +jobs: + test-and-upload: + runs-on: [gpumode-nvidia-arc] + container: + image: nvidia/cuda:12.4.0-devel-ubuntu22.04 + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.13' + + # Install dependencies + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + # Run the Python script or tests + - name: Run Python Tasks + run: | + python discord-bot.py ${{ github.event.number }}-${{ github.run_id }}-${{ github.run_attempt }} > test.log + env: + DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + + # Upload artifacts + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: test-results + path: test.log