1
0
Fork 0

IMPROVE: cron schedule and use step output (#126)

* use step output for populating repo name

* schedule cron every 12 hours
Dieser Commit ist enthalten in:
Faizaan Gagan 2021-06-26 19:07:08 +05:30 committet von GitHub
Ursprung f80f40d6b3
Commit be86c77a77
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -7,7 +7,7 @@ on:
- main - main
pull_request: pull_request:
schedule: schedule:
- cron: '0 0 * * *' - cron: '0 */12 * * *'
jobs: jobs:
build: build:
@ -53,26 +53,27 @@ jobs:
repository: discourse/discourse repository: discourse/discourse
fetch-depth: 1 fetch-depth: 1
- run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV - name: Fetch Repo Name
shell: bash id: repo-name
run: echo "::set-output name=value::$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')"
- name: Install plugin - name: Install plugin
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
path: plugins/${{ env.REPOSITORY_NAME }} path: plugins/${{ steps.repo-name.outputs.value }}
fetch-depth: 1 fetch-depth: 1
- name: Check spec existence - name: Check spec existence
id: check_spec id: check_spec
uses: andstor/file-existence-action@v1 uses: andstor/file-existence-action@v1
with: with:
files: "plugins/${{ env.REPOSITORY_NAME }}/spec" files: "plugins/${{ steps.repo-name.outputs.value }}/spec"
- name: Check qunit existence - name: Check qunit existence
id: check_qunit id: check_qunit
uses: andstor/file-existence-action@v1 uses: andstor/file-existence-action@v1
with: with:
files: "plugins/${{ env.REPOSITORY_NAME }}/test/javascripts" files: "plugins/${{ steps.repo-name.outputs.value }}/test/javascripts"
- name: Setup Git - name: Setup Git
run: | run: |
@ -105,7 +106,7 @@ jobs:
- name: Lint English locale - name: Lint English locale
if: matrix.build_type == 'backend' if: matrix.build_type == 'backend'
run: bundle exec ruby script/i18n_lint.rb "plugins/${{ env.REPOSITORY_NAME }}/locales/{client,server}.en.yml" run: bundle exec ruby script/i18n_lint.rb "plugins/${{ steps.repo-name.outputs.value }}/locales/{client,server}.en.yml"
- name: Get yarn cache directory - name: Get yarn cache directory
id: yarn-cache-dir id: yarn-cache-dir
@ -130,9 +131,9 @@ jobs:
- name: Plugin RSpec with Coverage - name: Plugin RSpec with Coverage
if: matrix.build_type == 'backend' && steps.check_spec.outputs.files_exists == 'true' if: matrix.build_type == 'backend' && steps.check_spec.outputs.files_exists == 'true'
run: SIMPLECOV=1 bin/rake plugin:spec[${{ env.REPOSITORY_NAME }}] run: SIMPLECOV=1 bin/rake plugin:spec[${{ steps.repo-name.outputs.value }}]
- name: Plugin QUnit - name: Plugin QUnit
if: matrix.build_type == 'frontend' && steps.check_qunit.outputs.files_exists == 'true' if: matrix.build_type == 'frontend' && steps.check_qunit.outputs.files_exists == 'true'
run: bundle exec rake plugin:qunit['${{ env.REPOSITORY_NAME }}','1200000'] run: bundle exec rake plugin:qunit['${{ steps.repo-name.outputs.value }}','1200000']
timeout-minutes: 30 timeout-minutes: 30