Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix action failures #309

Merged
merged 16 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@
"yessss",
"zalgo",
"zpars",
"\u00ecnfo"
"\u00ecnfo",
"mkdocs"
]
}
7 changes: 5 additions & 2 deletions .github/workflows/build-deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@ on:
push:
branches:
- master
permissions: read-all
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 12
- run: pip install mkdocs-material mdx_truly_sane_lists
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
tags:
- v*
permissions: read-all
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
Expand Down
23 changes: 16 additions & 7 deletions .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,32 @@ concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

permissions: read-all

jobs:
build:
name: Mega-Linter
runs-on: ubuntu-latest

# Give the default GITHUB_TOKEN write permission to commit and push, comment
# issues, and post new Pull Requests; remove the ones you do not need
permissions:
contents: write
issues: write
pull-requests: write

steps:
# Git Checkout
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
fetch-depth: 0

# Mega-Linter
- name: Mega-Linter
id: ml
uses: oxsecurity/megalinter/flavors/javascript@v6
uses: oxsecurity/megalinter/flavors/javascript@v7
env:
# All available variables are described in documentation
# https://oxsecurity.github.io/megalinter/#configuration
Expand All @@ -46,7 +56,7 @@ jobs:
# Upload Mega-Linter artifacts
- name: Archive production artifacts
if: ${{ success() }} || ${{ failure() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: Mega-Linter reports
path: |
Expand All @@ -71,11 +81,10 @@ jobs:

# Push new commit if applicable
- name: Prepare commit
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/master'
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/master' && github.repository == github.event.pull_request.head.repo.full_name
run: sudo chown -Rc $UID .git/
- name: Commit and push applied linter fixes
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/master'
uses: stefanzweifel/git-auto-commit-action@v4
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/master' && github.repository == github.event.pull_request.head.repo.full_name
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
commit_message: "[Mega-Linter] Apply linters fixes"
3 changes: 2 additions & 1 deletion .github/workflows/publish-to_npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ on:
push:
branches:
- master
permissions: read-all
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: "12.x"
registry-url: "https://registry.npmjs.org"
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
issue_comment:
types: [created, deleted, edited]

permissions: read-all

###############
# Run the job #
###############
Expand All @@ -21,11 +23,14 @@ jobs:
#######################
markstale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
# only run on schedule
if: "github.event_name == 'schedule'"
if: github.event_name == 'schedule'
steps:
- name: Mark issue stale
uses: actions/stale@v4
uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: "This issue has been automatically marked as stale because it has not had recent activity.\nIt will be closed in 14 days if no further activity occurs.\nThank you for your contributions.\n\nIf you think this issue should stay open, please remove the `O: stale 🤖` label or comment on the issue."
Expand Down
48 changes: 34 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@ name: Test

on: [push, pull_request]

permissions: read-all

jobs:
test_java8_node_12:
name: Test - Debian - Java 8 - Node 12
runs-on: ubuntu-latest
container:
image: openjdk:8-jdk-stretch
image: openjdk:8-jdk-buster
timeout-minutes: 15
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install apt packages
run: "apt-get update && apt-get upgrade -y && apt-get -y install wget zip unzip sudo && apt-get clean && echo 'Installed linux dependencies'"
- name: Install node 12
run: curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt-get update && apt-get install -y nodejs
uses: actions/setup-node@v3
with:
node-version: 12
- name: Install dependencies and link
run: npm ci && npm link
- name: Run tests
Expand All @@ -30,13 +32,15 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install apt packages
run: "apt-get update && apt-get upgrade -y && apt-get -y install wget zip unzip sudo && apt-get clean && echo 'Installed linux dependencies'"
- name: Install node 13
run: curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt-get update && apt-get install -y nodejs
- name: Install node 12
uses: actions/setup-node@v3
with:
node-version: 12
- name: Install dependencies and link
run: npm ci && npm link
- name: Run tests
env:
DEBUG: "npm-groovy-lint"
run: npm run test

test_java14_latest_node_16:
Expand All @@ -49,7 +53,9 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install node 16
run: curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get update && apt-get install -y nodejs
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies and link
run: npm ci && npm link
- name: Run tests
Expand All @@ -65,15 +71,25 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install node 14
run: curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get update && apt-get install -y nodejs
uses: actions/setup-node@v3
with:
node-version: 14
- name: Install dependencies and link
run: npm ci && npm link
- name: Run tests
env:
DEBUG: "npm-groovy-lint"
run: npm run test:coverage
- name: Submitting code coverage to codecov
run: |
./node_modules/.bin/nyc report --reporter text-lcov > coverage.lcov
curl -s https://codecov.io/bash | bash
- name: Build coverage report
run: ./node_modules/.bin/nyc report --reporter text-lcov > coverage.lcov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
file: coverage.lcov
flags: unittests
verbose: true
dry_run: true

test_windows:
name: Test - Windows
Expand All @@ -85,6 +101,8 @@ jobs:
- name: Install dependencies and link
run: npm ci && npm link
- name: Run tests
env:
DEBUG: "npm-groovy-lint"
run: npm run test

test_mac:
Expand All @@ -97,4 +115,6 @@ jobs:
- name: Install dependencies and link
run: npm ci && npm link
- name: Run tests
env:
DEBUG: "npm-groovy-lint"
run: npm run test
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ Fixes:

## [4.1.0] 2020-04-12

- Upgrade to [Groovy 3.0.3](https://dl.bintray.com/groovy/maven/apache-groovy-binary-3.0.3.zip)
- Upgrade to [Groovy 3.0.3](https://groovy.jfrog.io/ui/native/dist-release-local/groovy-zips/apache-groovy-binary-3.0.3.zip)
- Automatic generation of fixable rules list for README
- Refactor CodeNarcServer.groovy

Expand Down
Loading