CI #189
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- "**" | |
- "!**-update-20**" | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: "0 0 * * MON" | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test 1. A target branch that has never been synced before | |
uses: ./ | |
with: | |
upstream-repository: fem-on-colab/is-synced-with-upstream-action | |
upstream-ref: test-1-source | |
target-ref: test-1-target | |
file-patterns: tests/*.py **/*.txt | |
commit-message-prefix: Sync with source branch | |
push-changes: false | |
expect-out-of-sync: true | |
expected-target-range: test-1-target..test-1-expected-diff | |
- name: Test 2. Changes to an existing file | |
uses: ./ | |
with: | |
upstream-repository: fem-on-colab/is-synced-with-upstream-action | |
upstream-ref: test-2-source | |
target-ref: test-2-target | |
file-patterns: tests/*.py **/*.txt | |
commit-message-prefix: Sync with source branch | |
push-changes: false | |
expect-out-of-sync: true | |
expected-target-range: test-2-target..test-2-expected-diff | |
- name: Test 3. A new file is added | |
uses: ./ | |
with: | |
upstream-repository: fem-on-colab/is-synced-with-upstream-action | |
upstream-ref: test-3-source | |
target-ref: test-3-target | |
file-patterns: tests/*.py **/*.txt | |
commit-message-prefix: Sync with source branch | |
push-changes: false | |
expect-out-of-sync: true | |
expected-target-range: test-3-target..test-3-expected-diff | |
- name: Test 4. A file is deleted | |
uses: ./ | |
with: | |
upstream-repository: fem-on-colab/is-synced-with-upstream-action | |
upstream-ref: test-4-source | |
target-ref: test-4-target | |
file-patterns: tests/*.py **/*.txt | |
commit-message-prefix: Sync with source branch | |
push-changes: false | |
expect-out-of-sync: true | |
expected-target-range: test-4-target..test-4-expected-diff | |
- name: Test 5. An unrelated file is changed | |
uses: ./ | |
with: | |
upstream-repository: fem-on-colab/is-synced-with-upstream-action | |
upstream-ref: test-5-source | |
target-ref: test-5-target | |
file-patterns: tests/*.py **/*.txt | |
commit-message-prefix: Sync with source branch | |
push-changes: false | |
expect-out-of-sync: false | |
- name: Test 6. Multiple upstream commits | |
uses: ./ | |
with: | |
upstream-repository: fem-on-colab/is-synced-with-upstream-action | |
upstream-ref: test-4-source | |
target-ref: test-2-target | |
file-patterns: tests/*.py **/*.txt | |
commit-message-prefix: Sync with source branch | |
push-changes: false | |
expect-out-of-sync: true | |
expected-target-range: test-2-target..test-4-expected-diff | |
- name: Test 7. Non-empty token | |
uses: ./ | |
with: | |
upstream-repository: fem-on-colab/is-synced-with-upstream-action | |
upstream-ref: test-3-source | |
target-ref: test-3-target | |
file-patterns: tests/*.py **/*.txt | |
commit-message-prefix: Sync with source branch | |
push-changes: false | |
expect-out-of-sync: true | |
expected-target-range: test-3-target..test-3-expected-diff | |
token: ${{ github.token }} | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --break-system-packages -q yamllint | |
- name: Run yamllint | |
run: | | |
python3 -m yamllint -d "{extends: default, rules: {document-start: {present: false}, line-length: disable, truthy: {check-keys: false}}}" . | |
warn: | |
runs-on: ubuntu-latest | |
if: github.repository == 'fem-on-colab/is-synced-with-upstream-action' && github.ref == 'refs/heads/main' && github.event_name == 'schedule' | |
steps: | |
- name: Warn if scheduled workflow is about to be disabled | |
uses: fem-on-colab/warn-workflow-about-to-be-disabled-action@main | |
with: | |
workflow-filename: ci.yml | |
days-elapsed: 50 |