This workflow will install Python dependencies, run tests and lint with a single version…
- User
This workflow will install Python dependencies, run tests and lint with a single version of Python
For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Pstion1
on: workflow_dispatch: schedule: - cron: '33 17 * * *'
permissions: contents: read
jobs: build:
runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@v4 - name: Set up Python 3.10 uses: actions/setup-python@v3 with: python-version: "3.10" - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt - name: Sdc env: CLUB_USERNAME: ${{ secrets.USERNAME }} CLUB_PASSWORD: ${{ secrets.PASSWORD }} COOKIES: ${{ secrets.COOKIES }} TGBOTAPI: ${{ secrets.TGBOTAPI }} TGID: ${{ secrets.TGID }} run: | python ./as.py使用 Node.js v20
- Assistant
- User
使用 Node.js v20
- Assistant
If you want to also set up Node.js v20 along with Python in the same GitHub Actions workflow, you can add a step to set up Node.js before running any Node.js-related commands. Below is the revised workflow that includes both Python and Node.js setups:
name: Pstion1 on: # Trigger the workflow manually workflow_dispatch: # Schedule the workflow to run every day at 17:33 UTC schedule: - cron: '33 17 * * *' permissions: contents: read jobs: build: runs-on: ubuntu-latest timeout-minutes: 10 steps: # Check out the latest version of the repository - uses: actions/checkout@v4 # Set up Python 3.10 - name: Set up Python 3.10 uses: actions/setup-python@v3 with: python-version: "3.10" # Set up Node.js v20 - name: Set up Node.js v20 uses: actions/setup-node@v3 with: node-version: "20" # Install Python dependencies from the requirements.txt file - name: Install Python dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt # Optionally, install Node.js dependencies (if you have a package.json file) - name: Install Node.js dependencies run: | npm install # Run the Python script with required environment variables - name: Sdc env: CLUB_USERNAME: ${{ secrets.USERNAME }} CLUB_PASSWORD: ${{ secrets.PASSWORD }} COOKIES: ${{ secrets.COOKIES }} TGBOTAPI: ${{ secrets.TGBOTAPI }} TGID: ${{ secrets.TGID }} run: | python ./as.py