From c5ecc2a04755823518bfd04f9fb0f958c7e1817b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=CC=88zgu=CC=88r=20Akgu=CC=88n?= Date: Sat, 4 Nov 2023 15:36:11 +0000 Subject: [PATCH 1/2] Do not run github actions on all branches Modifying github actions to only run for pushes to the main branch. One visible effect of running it on all branches was that PRs made from branches in the repository were being triggered twice. For example depandabot. Also add workflow_dispath to more actions, since I don't see why not... --- .github/workflows/chuffed.yml | 3 + .github/workflows/code-coverage-deploy.yml | 1 + .github/workflows/code-coverage.yml | 4 + .github/workflows/doc-coverage.yml | 3 + .github/workflows/essence-feature-stats.yml | 110 ++++++++++---------- .github/workflows/format.yml | 5 +- .github/workflows/kissat.yml | 3 + .github/workflows/minion.yml | 3 + .github/workflows/oxide.yml | 3 + .github/workflows/update-caches.yml | 4 +- 10 files changed, 83 insertions(+), 56 deletions(-) diff --git a/.github/workflows/chuffed.yml b/.github/workflows/chuffed.yml index 3313643d8..271d1c78e 100644 --- a/.github/workflows/chuffed.yml +++ b/.github/workflows/chuffed.yml @@ -1,9 +1,12 @@ # https://doc.rust-lang.org/cargo/guide/continuous-integration.html # https://ectobit.com/blog/speed-up-github-actions-rust-pipelines/ name: "solvers/chuffed" + on: workflow_dispatch: push: + branches: + - main # run for pushes to the main branch paths: - "solvers/chuffed/**" - "Cargo.*" diff --git a/.github/workflows/code-coverage-deploy.yml b/.github/workflows/code-coverage-deploy.yml index 0dcfe9489..0a130f1dc 100644 --- a/.github/workflows/code-coverage-deploy.yml +++ b/.github/workflows/code-coverage-deploy.yml @@ -1,4 +1,5 @@ name: "Code Coverage (Deploy)" + on: workflow_run: workflows: ["Code Coverage (Generate)"] diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index 3f55df833..d0099e9b5 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -1,7 +1,11 @@ name: "Code Coverage (Generate)" + on: push: + branches: + - main # run for pushes to the main branch pull_request: + workflow_dispatch: jobs: diff --git a/.github/workflows/doc-coverage.yml b/.github/workflows/doc-coverage.yml index d12c54cd2..c1906dc77 100644 --- a/.github/workflows/doc-coverage.yml +++ b/.github/workflows/doc-coverage.yml @@ -1,6 +1,9 @@ name: "Documentation Coverage" + on: push: + branches: + - main # run for pushes to the main branch pull_request: workflow_dispatch: diff --git a/.github/workflows/essence-feature-stats.yml b/.github/workflows/essence-feature-stats.yml index 4f5541ca5..c8bd1f844 100644 --- a/.github/workflows/essence-feature-stats.yml +++ b/.github/workflows/essence-feature-stats.yml @@ -1,66 +1,68 @@ - name: "tools/essence-feature-stats - Deploy to Github Pages" +name: "tools/essence-feature-stats - Deploy to Github Pages" - on: - push: - branches: - - main +on: + push: + branches: + - main # run for pushes to the main branch + pull_request: + workflow_dispatch: - env: - ESSENCE_DIR: "./EssenceCatalog" - CONJURE_DIR: "./conjure" - ESSENCE_EXAMPLES_REPO: "https://github.com/conjure-cp/EssenceCatalog.git" - CONJURE_REPO: "https://github.com/conjure-cp/conjure" - OUTPUT_PATH: "./web/static/index.html" - KEYWORD_BLOCKLIST: > - mInfo,finds,givens,enumGivens,enumLettings,lettings, - unnameds,strategyQ,Auto,Interactive,strategyA,trailCompact, - nameGenState,nbExtraGivens,representations,representationsTree, - originalDomains,trailGeneralised,trailVerbose,trailRewrites, - mLanguage,language,version,mStatements,Name,Declaration,Op +env: + ESSENCE_DIR: "./EssenceCatalog" + CONJURE_DIR: "./conjure" + ESSENCE_EXAMPLES_REPO: "https://github.com/conjure-cp/EssenceCatalog.git" + CONJURE_REPO: "https://github.com/conjure-cp/conjure" + OUTPUT_PATH: "./web/static/index.html" + KEYWORD_BLOCKLIST: > + mInfo,finds,givens,enumGivens,enumLettings,lettings, + unnameds,strategyQ,Auto,Interactive,strategyA,trailCompact, + nameGenState,nbExtraGivens,representations,representationsTree, + originalDomains,trailGeneralised,trailVerbose,trailRewrites, + mLanguage,language,version,mStatements,Name,Declaration,Op - jobs: - build: - name: "tools/essence-feature-stats: Build the tool and clone EssenceCatalog repo" +jobs: + build: + name: "tools/essence-feature-stats: Build the tool and clone EssenceCatalog repo" - runs-on: ubuntu-latest + runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.11"] + strategy: + matrix: + python-version: ["3.11"] - permissions: - contents: write + permissions: + contents: write - steps: - - name: Checkout code - uses: actions/checkout@v4 + steps: + - name: Checkout code + uses: actions/checkout@v4 - - name: Install Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} + - name: Install Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} - - name: Install python dependencies - run: pip install -r requirements.txt - working-directory: ./tools/essence-feature-usage-stats + - name: Install python dependencies + run: pip install -r requirements.txt + working-directory: ./tools/essence-feature-usage-stats - - name: Run main.py to generate the table - run: python main.py - working-directory: ./tools/essence-feature-usage-stats + - name: Run main.py to generate the table + run: python main.py + working-directory: ./tools/essence-feature-usage-stats - - name: Fix file permissions - run: chmod -v -R +rwx ./web/static/ - working-directory: ./tools/essence-feature-usage-stats + - name: Fix file permissions + run: chmod -v -R +rwx ./web/static/ + working-directory: ./tools/essence-feature-usage-stats + + - name: Add the .nojekyll file + run: touch ./web/static/.nojekyll + working-directory: ./tools/essence-feature-usage-stats + + - name: Deploy to GitHub Pages + uses: JamesIves/github-pages-deploy-action@v4.4.3 + with: + branch: gh-pages + folder: ./tools/essence-feature-usage-stats/web/static + target-folder: tools/essence-feature-usage-stats + commit-message: "Actions: Deploy the essence features usage table 🚀" - - name: Add the .nojekyll file - run: touch ./web/static/.nojekyll - working-directory: ./tools/essence-feature-usage-stats - - - name: Deploy to GitHub Pages - uses: JamesIves/github-pages-deploy-action@v4.4.3 - with: - branch: gh-pages - folder: ./tools/essence-feature-usage-stats/web/static - target-folder: tools/essence-feature-usage-stats - commit-message: "Actions: Deploy the essence features usage table 🚀" - diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 2b9bfd0ae..3da084ce8 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -3,8 +3,11 @@ name: "Formatting" on: - pull_request: push: + branches: + - main # run for pushes to the main branch + pull_request: + workflow_dispatch: jobs: rust: diff --git a/.github/workflows/kissat.yml b/.github/workflows/kissat.yml index 5cc1ffd90..5d1dfd9b2 100644 --- a/.github/workflows/kissat.yml +++ b/.github/workflows/kissat.yml @@ -1,8 +1,11 @@ # https://doc.rust-lang.org/cargo/guide/continuous-integration.html # https://ectobit.com/blog/speed-up-github-actions-rust-pipelines/ name: 'solvers/kissat' + on: push: + branches: + - main # run for pushes to the main branch pull_request: paths: - 'solvers/kissat/**' diff --git a/.github/workflows/minion.yml b/.github/workflows/minion.yml index 0fa56f635..5b8e349b4 100644 --- a/.github/workflows/minion.yml +++ b/.github/workflows/minion.yml @@ -1,6 +1,9 @@ name: "solvers/minion" + on: push: + branches: + - main # run for pushes to the main branch paths: - 'solvers/minion/**' - "Cargo.*" diff --git a/.github/workflows/oxide.yml b/.github/workflows/oxide.yml index b8e4aa9fa..982f51cc1 100644 --- a/.github/workflows/oxide.yml +++ b/.github/workflows/oxide.yml @@ -1,6 +1,9 @@ name: "conjure-oxide" + on: push: + branches: + - main # run for pushes to the main branch paths: - 'src/**' - "Cargo.*" diff --git a/.github/workflows/update-caches.yml b/.github/workflows/update-caches.yml index 1d6d46281..7f0443c63 100644 --- a/.github/workflows/update-caches.yml +++ b/.github/workflows/update-caches.yml @@ -1,8 +1,10 @@ name: Full Caches + on: push: branches: - - main + - main # run for pushes to the main branch + workflow_dispatch: env: GH_TOKEN: ${{ github.token }} From 811c2c4a6b1790773ab45919b33ea4fd91bf3ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=CC=88zgu=CC=88r=20Akgu=CC=88n?= Date: Sat, 4 Nov 2023 15:47:11 +0000 Subject: [PATCH 2/2] do not run on PRs --- .github/workflows/essence-feature-stats.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/essence-feature-stats.yml b/.github/workflows/essence-feature-stats.yml index c8bd1f844..d64866e71 100644 --- a/.github/workflows/essence-feature-stats.yml +++ b/.github/workflows/essence-feature-stats.yml @@ -4,7 +4,6 @@ on: push: branches: - main # run for pushes to the main branch - pull_request: workflow_dispatch: env: