diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 057208eda32..b308d844199 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,14 +1,17 @@ -name: "Pull Request Labeler" +name: Pull Request Labeler + on: -- pull_request_target + - pull_request_target + +permissions: + contents: read + pull-requests: write jobs: triage: - permissions: - contents: read - pull-requests: write runs-on: ubuntu-latest + steps: - - uses: actions/labeler@v4 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" + - uses: actions/labeler@v4 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/licenses.yml b/.github/workflows/licenses.yml index de665ecf290..40e53ad0c4a 100644 --- a/.github/workflows/licenses.yml +++ b/.github/workflows/licenses.yml @@ -15,7 +15,7 @@ permissions: jobs: build: - if: "!(github.event_name == 'push' && github.repository == 'discourse/discourse-private-mirror')" + if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror' name: run runs-on: ubuntu-latest container: discourse/discourse_test:slim @@ -36,8 +36,7 @@ jobs: with: path: vendor/bundle key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gem- + restore-keys: ${{ runner.os }}-gem- - name: Setup gems run: | @@ -61,8 +60,7 @@ jobs: with: path: ${{ steps.yarn-cache-dir.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + restore-keys: ${{ runner.os }}-yarn- - name: Check RubyGems Licenses if: ${{ !cancelled() }} diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index f2e8f47e6c1..0ded454e9e6 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -15,7 +15,7 @@ permissions: jobs: build: - if: "!(github.event_name == 'push' && github.repository == 'discourse/discourse-private-mirror')" + if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror' name: run runs-on: ubuntu-latest container: discourse/discourse_test:slim @@ -39,8 +39,7 @@ jobs: with: path: vendor/bundle key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gem- + restore-keys: ${{ runner.os }}-gem- - name: Setup gems run: | @@ -61,8 +60,7 @@ jobs: with: path: ${{ steps.yarn-cache-dir.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + restore-keys: ${{ runner.os }}-yarn- - name: Yarn install run: yarn install --frozen-lockfile diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 361466be61c..bf1d1bce817 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ permissions: jobs: build: - if: "!(github.event_name == 'push' && github.repository == 'discourse/discourse-private-mirror')" + if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror' name: ${{ matrix.target }} ${{ matrix.build_type }} ${{ matrix.ruby }} runs-on: ${{ (matrix.build_type == 'annotations') && 'ubuntu-latest' || 'ubuntu-20.04-8core' }} container: discourse/discourse_test:slim${{ (matrix.build_type == 'frontend' || matrix.build_type == 'system') && '-browsers' || '' }}${{ (matrix.ruby == '3.1') && '-ruby-3.1.0' || '' }} @@ -29,7 +29,7 @@ jobs: PGUSER: discourse PGPASSWORD: discourse USES_PARALLEL_DATABASES: ${{ matrix.build_type == 'backend' || matrix.build_type == 'system' }} - CAPBYARA_DEFAULT_MAX_WAIT_TIME: 4 + CABPYARA_DEFAULT_MAX_WAIT_TIME: 4 strategy: fail-fast: false @@ -37,7 +37,7 @@ jobs: matrix: build_type: [backend, frontend, system, annotations] target: [core, plugins] - ruby: ['3.2'] + ruby: ["3.2"] exclude: - build_type: annotations target: plugins @@ -72,8 +72,7 @@ jobs: with: path: vendor/bundle key: ${{ runner.os }}-${{ matrix.ruby }}-gem-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.ruby }}-gem- + restore-keys: ${{ runner.os }}-${{ matrix.ruby }}-gem- - name: Setup gems run: | @@ -94,8 +93,7 @@ jobs: with: path: ${{ steps.yarn-cache-dir.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + restore-keys: ${{ runner.os }}-yarn- - name: Yarn install run: yarn install --frozen-lockfile @@ -113,10 +111,9 @@ jobs: id: app-cache with: path: tmp/app-cache - key: >- # postgres version, hash of migrations, "parallel?" + key: >- ${{ runner.os }}- ${{ hashFiles('.github/workflows/tests.yml') }}- - ${{ matrix.postgres }}- ${{ hashFiles('db/**/*', 'plugins/**/db/**/*') }}- ${{ env.USES_PARALLEL_DATABASES }} @@ -229,7 +226,7 @@ jobs: timeout-minutes: 30 core_frontend_tests: - if: "!(github.event_name == 'push' && github.repository == 'discourse/discourse-private-mirror')" + if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror' name: core frontend (${{ matrix.browser }}) runs-on: ubuntu-20.04-8core container: @@ -267,8 +264,7 @@ jobs: with: path: ${{ steps.yarn-cache-dir.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + restore-keys: ${{ runner.os }}-yarn- - name: Yarn install working-directory: ./app/assets/javascripts/discourse @@ -278,15 +274,15 @@ jobs: working-directory: ./app/assets/javascripts/discourse run: | mkdir /tmp/emberbuild - yarn ember build --environment=test -o /tmp/emberbuild + yarn ember build --environment=test -o /tmp/emberbuild - name: Core QUnit working-directory: ./app/assets/javascripts/discourse - run: yarn ember exam --path /tmp/emberbuild --load-balance --parallel=5 --launch "${{ env.TESTEM_BROWSER }}" --write-execution-file --random + run: yarn ember exam --path /tmp/emberbuild --load-balance --parallel=5 --launch "${{ env.TESTEM_BROWSER }}" --write-execution-file --random timeout-minutes: 15 - uses: actions/upload-artifact@v3 if: ${{ always() }} with: - name: ember-exam-execution-${{matrix.browser}} + name: ember-exam-execution-${{ matrix.browser }} path: ./app/assets/javascripts/discourse/test-execution-*.json diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index a72d8c1dbff..8a1747478c2 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -237,8 +237,8 @@ RSpec.configure do |config| WebMock.disable_net_connect!(allow_localhost: true, allow: [Webdrivers::Chromedriver.base_url]) - if ENV["CAPBYARA_DEFAULT_MAX_WAIT_TIME"].present? - Capybara.default_max_wait_time = ENV["CAPBYARA_DEFAULT_MAX_WAIT_TIME"].to_i + if ENV["CAPYBARA_DEFAULT_MAX_WAIT_TIME"].present? + Capybara.default_max_wait_time = ENV["CAPYBARA_DEFAULT_MAX_WAIT_TIME"].to_i end Capybara.threadsafe = true