diff options
author | Claire <claire.github-309c@sitedethib.com> | 2023-02-03 19:07:58 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2023-02-03 19:23:27 +0100 |
commit | aeacebb3d75112d0d22b9829813c388eef6ce5af (patch) | |
tree | 98fced042da7c37db7b401eb197cc44c7aa1a41c /.github/workflows | |
parent | ec26f7c1b16ca1429991212292e35e520c617485 (diff) | |
parent | 79ca19e9b2e701d98c80afd939a98c2a3ef74830 (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `.github/workflows/build-image.yml`: Upstream updated `docker/build-push-action`, and we a different config for `docker/metadata-action` so the lines directly above were different, but it's not a real conflict. Upgraded `docker/build-push-action` as upstream did. - `app/javascript/mastodon/features/compose/components/compose_form.js`: Upstream changed the codestyle near a line we had modified to accommodate configurable character count. Kept our change.
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/build-image.yml | 8 | ||||
-rw-r--r-- | .github/workflows/lint-css.yml | 48 | ||||
-rw-r--r-- | .github/workflows/lint-js.yml | 40 | ||||
-rw-r--r-- | .github/workflows/lint-json.yml | 2 | ||||
-rw-r--r-- | .github/workflows/lint-ruby.yml | 41 | ||||
-rw-r--r-- | .github/workflows/lint-yml.yml | 2 | ||||
-rw-r--r-- | .github/workflows/linter.yml | 83 |
7 files changed, 140 insertions, 84 deletions
diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 51ee8a071..36e9bf370 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -15,6 +15,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 @@ -34,10 +39,11 @@ jobs: type=raw,value=latest,enable={{is_default_branch}} type=edge,branch=main type=sha,prefix=,format=long - - uses: docker/build-push-action@v3 + - uses: docker/build-push-action@v4 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 }} 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/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/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-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/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: diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml deleted file mode 100644 index b6438d665..000000000 --- a/.github/workflows/linter.yml +++ /dev/null @@ -1,83 +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 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 # - ################################ - - 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 }} - 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 |