Skip to content

(#TheTrueLtaker) gen9pokeconverge: unbanning heatrock and banning sme… #694

(#TheTrueLtaker) gen9pokeconverge: unbanning heatrock and banning sme…

(#TheTrueLtaker) gen9pokeconverge: unbanning heatrock and banning sme… #694

Workflow file for this run

# Action to test that listed tour codes can be parsed by Showdown
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push but only for the master branch, or any pull request events
push:
branches: [ master ]
pull_request:
types: [ opened, synchronize, reopened ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout OTC
uses: actions/checkout@v3
with:
fetch-depth: 0
env:
ALL_CHANGED_TOUR_FILES: ''
# Get and list changed .tour files
- name: Get all changed tour files for PR
id: changed-tour-files
if: github.event_name == 'pull_request'
uses: tj-actions/changed-files@v41
with:
files: |
formats/**.tour
# Checkout Showdown
- name: Checkout Pokemon Showdown
uses: actions/checkout@v3
with:
repository: smogon/pokemon-showdown
path: pokemon-showdown
# Install Node
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
# Install actions/core
- name: Install actions/core
run: npm install @actions/core
# Generate custom battle tests for Showdown (PR tours only)
- name: Generate Showdown Custom Tests (PR Tours)
if: github.event_name == 'pull_request'
env:
ALL_CHANGED_TOUR_FILES: ${{ steps.changed-tour-files.outputs.all_changed_files }}
run: |
echo "Changed tour files: $ALL_CHANGED_TOUR_FILES"
touch .env
echo ALL_CHANGED_TOUR_FILES=$ALL_CHANGED_TOUR_FILES >> .env
node $GITHUB_WORKSPACE/test/create-custom-tests.js
working-directory: test
# Generate custom battle tests for Showdown (all listed tours)
- name: Generate Showdown Custom Tests (All Listed Tours)
if: github.event_name != 'pull_request'
run: node $GITHUB_WORKSPACE/test/create-custom-tests.js
working-directory: test
# Inject custom battle test into Showdown
- name: Inject Showdown Custom Tests
run: |
echo Injecting custom tests...
cp $GITHUB_WORKSPACE/test/operationtourcode.js /home/runner/work/OTC/OTC/pokemon-showdown/test/sim/misc/operationtourcode.js
echo Finished injecting custom tests
# Install mocha
- name: Install mocha
run: npm install -g mocha@10.2.0
# Execute custom battle tests
- name: Run Showdown Custom Tests
run: npx mocha -g "OperationTourCode"
working-directory: /home/runner/work/OTC/OTC/pokemon-showdown