From d9088ef3272421a9267467fb95674d4b4afb38ab Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Sun, 29 Jan 2023 17:44:03 -0500 Subject: Separate ESLint CI from Superlinter (#23029) * Separate ESLint CI from Superlinter * Correct JS indenting level * Remove extra semicolons with ESLint autofix --- .github/workflows/lint-js.yml | 40 ++++++++++++++++++++++++++++++++++++++++ .github/workflows/linter.yml | 2 -- 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/lint-js.yml (limited to '.github/workflows') diff --git a/.github/workflows/lint-js.yml b/.github/workflows/lint-js.yml new file mode 100644 index 000000000..49d989771 --- /dev/null +++ b/.github/workflows/lint-js.yml @@ -0,0 +1,40 @@ +name: JavaScript Linting +on: + push: + branches-ignore: + - 'dependabot/**' + paths: + - 'package.json' + - 'yarn.lock' + - '.prettier*' + - '.eslint*' + - '**/*.js' + - '.github/workflows/lint-js.yml' + + pull_request: + paths: + - 'package.json' + - 'yarn.lock' + - '.prettier*' + - '.eslint*' + - '**/*.js' + - '.github/workflows/lint-js.yml' + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Clone repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + cache: yarn + + - name: Install all yarn packages + run: yarn --frozen-lockfile + + - name: ESLint + run: yarn test:lint:js diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index b6438d665..575732845 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -74,10 +74,8 @@ jobs: DEFAULT_BRANCH: main NO_COLOR: 1 # https://github.com/xt0rted/stylelint-problem-matcher/issues/360 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.js LINTER_RULES_PATH: . RUBY_CONFIG_FILE: .rubocop.yml VALIDATE_ALL_CODEBASE: false VALIDATE_CSS: true - VALIDATE_JAVASCRIPT_ES: true VALIDATE_RUBY: true -- cgit From 4917e38d94ad8dcd89069dc2eb5d544a73098010 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Sun, 29 Jan 2023 18:23:52 -0500 Subject: Separate Stylelint from Superlinter (#23303) --- .github/workflows/lint-css.yml | 48 ++++++++++++++++++++++++++++++++++++++++++ .github/workflows/linter.yml | 13 ------------ 2 files changed, 48 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/lint-css.yml (limited to '.github/workflows') diff --git a/.github/workflows/lint-css.yml b/.github/workflows/lint-css.yml new file mode 100644 index 000000000..431b88e8d --- /dev/null +++ b/.github/workflows/lint-css.yml @@ -0,0 +1,48 @@ +name: CSS Linting +on: + push: + branches-ignore: + - 'dependabot/**' + paths: + - 'package.json' + - 'yarn.lock' + - '.prettier*' + - 'stylelint.config.js' + - '**/*.css' + - '**/*.scss' + - '.github/workflows/lint-css.yml' + - '.github/stylelint-matcher.json' + + pull_request: + paths: + - 'package.json' + - 'yarn.lock' + - '.prettier*' + - 'stylelint.config.js' + - '**/*.css' + - '**/*.scss' + - '.github/workflows/lint-css.yml' + - '.github/stylelint-matcher.json' + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Clone repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + cache: yarn + + - name: Install all yarn packages + run: yarn --frozen-lockfile + + - uses: xt0rted/stylelint-problem-matcher@v1 + + - run: echo "::add-matcher::.github/stylelint-matcher.json" + + - name: Stylelint + run: yarn test:lint:sass diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 575732845..58e6fcb25 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -50,19 +50,8 @@ jobs: # Full git history is needed to get a proper list of changed files within `super-linter` fetch-depth: 0 - - name: Set-up Node.js - uses: actions/setup-node@v3 - with: - node-version-file: .nvmrc - cache: yarn - - name: Install dependencies - run: yarn install --frozen-lockfile - name: Set-up RuboCop Problem Mathcher uses: r7kamura/rubocop-problem-matchers-action@v1 - - name: Set-up Stylelint Problem Matcher - uses: xt0rted/stylelint-problem-matcher@v1 - # https://github.com/xt0rted/stylelint-problem-matcher/issues/360 - - run: echo "::add-matcher::.github/stylelint-matcher.json" ################################ # Run Linter against code base # @@ -70,12 +59,10 @@ jobs: - name: Lint Code Base uses: github/super-linter@v4 env: - CSS_FILE_NAME: stylelint.config.js DEFAULT_BRANCH: main NO_COLOR: 1 # https://github.com/xt0rted/stylelint-problem-matcher/issues/360 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} LINTER_RULES_PATH: . RUBY_CONFIG_FILE: .rubocop.yml VALIDATE_ALL_CODEBASE: false - VALIDATE_CSS: true VALIDATE_RUBY: true -- cgit From b58bf74e35039a29ca3794ea100a19d4d07cc810 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Sun, 29 Jan 2023 18:39:31 -0500 Subject: Filter Superlinter to Ruby files only (#21976) --- .github/workflows/lint-ruby.yml | 41 +++++++++++++++++++++++++ .github/workflows/linter.yml | 68 ----------------------------------------- 2 files changed, 41 insertions(+), 68 deletions(-) create mode 100644 .github/workflows/lint-ruby.yml delete mode 100644 .github/workflows/linter.yml (limited to '.github/workflows') diff --git a/.github/workflows/lint-ruby.yml b/.github/workflows/lint-ruby.yml new file mode 100644 index 000000000..b834e3053 --- /dev/null +++ b/.github/workflows/lint-ruby.yml @@ -0,0 +1,41 @@ +name: Ruby Linting +on: + push: + branches-ignore: + - 'dependabot/**' + paths: + - 'Gemfile*' + - '.rubocop.yml' + - '**/*.rb' + - '**/*.rake' + - '.github/workflows/lint-ruby.yml' + + pull_request: + paths: + - 'Gemfile*' + - '.rubocop.yml' + - '**/*.rb' + - '**/*.rake' + - '.github/workflows/lint-ruby.yml' + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set-up RuboCop Problem Mathcher + uses: r7kamura/rubocop-problem-matchers-action@v1 + + - name: Run rubocop + uses: github/super-linter@v4 + env: + DEFAULT_BRANCH: main + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + LINTER_RULES_PATH: . + RUBY_CONFIG_FILE: .rubocop.yml + VALIDATE_ALL_CODEBASE: false + VALIDATE_RUBY: true diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml deleted file mode 100644 index 58e6fcb25..000000000 --- a/.github/workflows/linter.yml +++ /dev/null @@ -1,68 +0,0 @@ ---- -################################# -################################# -## Super Linter GitHub Actions ## -################################# -################################# -name: Lint Code Base - -# -# Documentation: -# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions -# - -############################# -# Start the job on all push # -############################# -on: - push: - branches-ignore: [main] - # Remove the line above to run when pushing to master - pull_request: - branches: [main] - -############### -# Set the Job # -############### -permissions: - checks: write - contents: read - pull-requests: write - statuses: write - -jobs: - build: - # Name the Job - name: Lint Code Base - # Set the agent to run on - runs-on: ubuntu-latest - - ################## - # Load all steps # - ################## - steps: - ########################## - # Checkout the code base # - ########################## - - name: Checkout Code - uses: actions/checkout@v3 - with: - # Full git history is needed to get a proper list of changed files within `super-linter` - fetch-depth: 0 - - - name: Set-up RuboCop Problem Mathcher - uses: r7kamura/rubocop-problem-matchers-action@v1 - - ################################ - # Run Linter against code base # - ################################ - - name: Lint Code Base - uses: github/super-linter@v4 - env: - DEFAULT_BRANCH: main - NO_COLOR: 1 # https://github.com/xt0rted/stylelint-problem-matcher/issues/360 - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - LINTER_RULES_PATH: . - RUBY_CONFIG_FILE: .rubocop.yml - VALIDATE_ALL_CODEBASE: false - VALIDATE_RUBY: true -- cgit From 56d1af753d7929817ec25308e0e01c2ab6ed58dc Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Sun, 29 Jan 2023 21:07:19 -0500 Subject: Only build latest commit on branch for image (#23306) --- .github/workflows/build-image.yml | 5 +++++ 1 file changed, 5 insertions(+) (limited to '.github/workflows') diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index c58229c4d..97cc0c5ce 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -16,6 +16,11 @@ permissions: jobs: build-image: runs-on: ubuntu-latest + + concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + steps: - uses: actions/checkout@v3 - uses: hadolint/hadolint-action@v3.1.0 -- cgit From 9400bdbce54989e461848a78c4656b71ea847d44 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Feb 2023 20:09:43 +0900 Subject: Bump docker/build-push-action from 3 to 4 (#23333) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3 to 4. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v3...v4) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 97cc0c5ce..0c84b23b6 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -42,7 +42,7 @@ jobs: type=pep440,pattern={{raw}} type=pep440,pattern=v{{major}}.{{minor}} type=ref,event=pr - - uses: docker/build-push-action@v3 + - uses: docker/build-push-action@v4 with: context: . platforms: linux/amd64,linux/arm64 -- cgit From 1c335ac53a98c0f4f97a0ce5c8166cd2285c02ad Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 1 Feb 2023 13:15:42 +0100 Subject: Fix official docker images nto being compatible with some cloud providers (#23354) See #23333 and https://github.com/docker/buildx/issues/1533 --- .github/workflows/build-image.yml | 1 + 1 file changed, 1 insertion(+) (limited to '.github/workflows') diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 0c84b23b6..9962bbde6 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -46,6 +46,7 @@ jobs: with: context: . platforms: linux/amd64,linux/arm64 + provenance: false builder: ${{ steps.buildx.outputs.name }} push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} -- cgit From 420f33ccb95081b960510af3c746a525a370f6bb Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Wed, 1 Feb 2023 23:15:11 +0900 Subject: Skip locales linting (#23352) --- .github/workflows/lint-json.yml | 2 ++ .github/workflows/lint-yml.yml | 2 ++ 2 files changed, 4 insertions(+) (limited to '.github/workflows') diff --git a/.github/workflows/lint-json.yml b/.github/workflows/lint-json.yml index 5bf4349b3..524ed083a 100644 --- a/.github/workflows/lint-json.yml +++ b/.github/workflows/lint-json.yml @@ -9,6 +9,7 @@ on: - '.prettier*' - '**/*.json' - '.github/workflows/lint-json.yml' + - '!app/javascript/mastodon/locales/*.json' pull_request: paths: @@ -17,6 +18,7 @@ on: - '.prettier*' - '**/*.json' - '.github/workflows/lint-json.yml' + - '!app/javascript/mastodon/locales/*.json' jobs: lint: diff --git a/.github/workflows/lint-yml.yml b/.github/workflows/lint-yml.yml index b939ec8ce..48f8170b3 100644 --- a/.github/workflows/lint-yml.yml +++ b/.github/workflows/lint-yml.yml @@ -10,6 +10,7 @@ on: - '**/*.yaml' - '**/*.yml' - '.github/workflows/lint-yml.yml' + - '!config/locales/*.yml' pull_request: paths: @@ -19,6 +20,7 @@ on: - '**/*.yaml' - '**/*.yml' - '.github/workflows/lint-yml.yml' + - '!config/locales/*.yml' jobs: lint: -- cgit