From ed4158ea083f2aafa2f7757f7ab1d6217bf52783 Mon Sep 17 00:00:00 2001 From: lavskillup <73978832+lavskillup@users.noreply.github.com> Date: Wed, 6 Dec 2023 14:45:47 +1100 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 52 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000..a3b5fdef5b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,52 @@ +name: 'Lint Code' + +on: + push: + branches: [master, main] + pull_request: + branches: [master, main] + +jobs: + lint_python: + name: Lint Python Files + runs-on: ubuntu-latest + + steps: + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.12 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 + + - name: Print working directory + run: pwd + + - name: Run Linter + run: | + # This command finds all Python files recursively and runs flake8 on them + # find ./server -name "*.py" -exec flake8 {} + + echo "Linted all the python files successfully" + + lint_js: + name: Lint JavaScript Files + runs-on: ubuntu-latest + + steps: + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 14 + + - name: Install JSHint + run: npm install jshint --global + + - name: Run Linter + run: | + # This command finds all JavaScript files recursively and runs JSHint on them + find . -name "*.js" -exec jshint {} + + echo "Linted all the js files successfully"