From 6f8e5b69751d52f6b1f481e2c98277c6a36bd821 Mon Sep 17 00:00:00 2001 From: zargot Date: Fri, 29 Nov 2024 11:52:25 -0500 Subject: [PATCH 01/11] refactor --- .github/actions/setup.yml | 13 +++++++++++++ .github/workflows/test-code.yml | 9 +-------- 2 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 .github/actions/setup.yml diff --git a/.github/actions/setup.yml b/.github/actions/setup.yml new file mode 100644 index 00000000..bff853cf --- /dev/null +++ b/.github/actions/setup.yml @@ -0,0 +1,13 @@ +name: Setup + +runs: + using: composite + steps: + - uses: actions/setup-python@v4 + with: + python-version: '3.8' + cache: 'pip' + - run: pip install -r requirements.txt + - run: pip install -r tests/requirements.txt + - run: pip install -r docs/requirements.txt + - run: pip install . diff --git a/.github/workflows/test-code.yml b/.github/workflows/test-code.yml index 6d2e0b62..a87b861e 100644 --- a/.github/workflows/test-code.yml +++ b/.github/workflows/test-code.yml @@ -5,14 +5,7 @@ on: [pull_request] jobs: test: runs-on: ubuntu-latest - name: Test steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: '3.10' - cache: 'pip' # caching pip dependencies - - run: pip install -r requirements.txt - - run: pip install -r tests/requirements.txt - - run: pip install . + - uses: /.github/actions/setup - run: python -m unittest discover tests From 8c928cdcd839f3733d086d5907e5979e934b1837 Mon Sep 17 00:00:00 2001 From: zargot Date: Fri, 29 Nov 2024 12:06:46 -0500 Subject: [PATCH 02/11] fix --- .github/workflows/test-code.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-code.yml b/.github/workflows/test-code.yml index a87b861e..19b13d11 100644 --- a/.github/workflows/test-code.yml +++ b/.github/workflows/test-code.yml @@ -7,5 +7,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: /.github/actions/setup + - uses: ./.github/actions/setup - run: python -m unittest discover tests From f682d7b545b01bd6ceeeb96ff301c68d10df2f6f Mon Sep 17 00:00:00 2001 From: zargot Date: Fri, 29 Nov 2024 12:09:04 -0500 Subject: [PATCH 03/11] fix --- .github/actions/{setup.yml => setup/action.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/actions/{setup.yml => setup/action.yml} (100%) diff --git a/.github/actions/setup.yml b/.github/actions/setup/action.yml similarity index 100% rename from .github/actions/setup.yml rename to .github/actions/setup/action.yml From e63743738a911c7a622e692dde133a79eddea625 Mon Sep 17 00:00:00 2001 From: zargot Date: Fri, 29 Nov 2024 12:11:38 -0500 Subject: [PATCH 04/11] fix --- .github/actions/setup/action.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index bff853cf..05f8bba9 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -7,7 +7,10 @@ runs: with: python-version: '3.8' cache: 'pip' - - run: pip install -r requirements.txt - - run: pip install -r tests/requirements.txt - - run: pip install -r docs/requirements.txt - - run: pip install . + - run: | + set -e + pip install -r requirements.txt + pip install -r tests/requirements.txt + pip install -r docs/requirements.txt + pip install . + shell: bash From 2236246e974234f122f14997b7657e5e5291ba1c Mon Sep 17 00:00:00 2001 From: zargot Date: Fri, 29 Nov 2024 12:17:56 -0500 Subject: [PATCH 05/11] refactor more --- .github/workflows/lint.yml | 12 +++--------- .github/workflows/publish-docs.yml | 8 ++------ .github/workflows/test-docs.yml | 10 ++-------- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f3c9831c..28408bbe 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,14 +7,8 @@ jobs: runs-on: ubuntu-latest name: Lint steps: - - name: Check out source repository - uses: actions/checkout@v2 - - name: Set up Python environment - uses: actions/setup-python@v2 - with: - python-version: "3.10" - - name: flake8 Lint - uses: py-actions/flake8@v2 + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup + - uses: py-actions/flake8@v2.3.0 with: path: "src tests" - max-line-length: "80" diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index b253869f..b08e9420 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -14,16 +14,12 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup - uses: nikeee/setup-pandoc@v1 - uses: quarto-dev/quarto-actions/setup@v2.0.3 - - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Install python dependencies - run: | - pip install -r requirements.txt - pip install -r docs/requirements.txt - name: Render Quarto docs run: python tools/render_quarto_docs.py - name: Build and Commit diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml index 66b72973..be7cc7e2 100644 --- a/.github/workflows/test-docs.yml +++ b/.github/workflows/test-docs.yml @@ -14,18 +14,12 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/setup-python@v2 - with: - python-version: '3.8' + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup - uses: nikeee/setup-pandoc@v1 - uses: quarto-dev/quarto-actions/setup@v2.0.3 - - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Install python dependencies - run: | - pip install -r requirements.txt - pip install -r docs/requirements.txt - name: Render Quarto docs run: python src/odm_validation/tools/render_quarto_docs.py - name: Build and Commit From f9d2e78ee25dadc78008ba7cff18842d07cc81f1 Mon Sep 17 00:00:00 2001 From: zargot Date: Mon, 2 Dec 2024 17:32:04 -0500 Subject: [PATCH 06/11] work --- .github/actions/setup/action.yml | 16 ---------------- .github/workflows/lint.yml | 7 +++++-- .github/workflows/publish-docs.yml | 16 ++++------------ .github/workflows/test-code.yml | 2 +- .github/workflows/test-docs.yml | 16 +++------------- 5 files changed, 13 insertions(+), 44 deletions(-) delete mode 100644 .github/actions/setup/action.yml diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml deleted file mode 100644 index 05f8bba9..00000000 --- a/.github/actions/setup/action.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Setup - -runs: - using: composite - steps: - - uses: actions/setup-python@v4 - with: - python-version: '3.8' - cache: 'pip' - - run: | - set -e - pip install -r requirements.txt - pip install -r tests/requirements.txt - pip install -r docs/requirements.txt - pip install . - shell: bash diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 28408bbe..55c518b2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,7 +8,10 @@ jobs: name: Lint steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/setup - - uses: py-actions/flake8@v2.3.0 + - uses: actions/setup-python@v5 + with: + python-version: "3.8" + - name: flake8 Lint + uses: py-actions/flake8@v2 with: path: "src tests" diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index b08e9420..0d2b9ee0 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -1,4 +1,5 @@ name: Generate docs and push to Github Pages + on: push: branches: @@ -10,23 +11,14 @@ on: - 'LICENSE' - 'assets/**' - 'docs/**' + jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/setup - - uses: nikeee/setup-pandoc@v1 - - uses: quarto-dev/quarto-actions/setup@v2.0.3 - with: - fetch-depth: 0 - - name: Render Quarto docs - run: python tools/render_quarto_docs.py - - name: Build and Commit - uses: sphinx-notes/pages@2.1 # requires checkout with `fetch-depth: 0` - with: - documentation_path: docs - target_branch: gh-pages + - uses: ./.github/actions/install-pkg + - uses: ./.github/actions/render-docs - name: Set GH-Pages domain name run: echo 'validate-docs.phes-odm.org' > ${{ github.workspace }}/CNAME - name: Commit CNAME file diff --git a/.github/workflows/test-code.yml b/.github/workflows/test-code.yml index 19b13d11..c6d216f7 100644 --- a/.github/workflows/test-code.yml +++ b/.github/workflows/test-code.yml @@ -7,5 +7,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/setup + - uses: ./.github/actions/install-pkg - run: python -m unittest discover tests diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml index be7cc7e2..a2a1e89c 100644 --- a/.github/workflows/test-docs.yml +++ b/.github/workflows/test-docs.yml @@ -1,4 +1,4 @@ -name: Test documentation generation +name: test documentation generation on: pull_request: @@ -15,15 +15,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/setup - - uses: nikeee/setup-pandoc@v1 - - uses: quarto-dev/quarto-actions/setup@v2.0.3 - with: - fetch-depth: 0 - - name: Render Quarto docs - run: python src/odm_validation/tools/render_quarto_docs.py - - name: Build and Commit - uses: sphinx-notes/pages@2.1 # requires checkout with `fetch-depth: 0` - with: - documentation_path: docs - target_branch: gh-pages + - uses: ./.github/actions/install-pkg + - uses: ./.github/actions/render-docs From 07cc536940bd2ea3857265f9f3302ffc1039ef37 Mon Sep 17 00:00:00 2001 From: zargot Date: Mon, 2 Dec 2024 17:33:58 -0500 Subject: [PATCH 07/11] work --- .github/actions/install-pkg/action.yml | 16 ++++++++++++++++ .github/actions/render-docs/action.yml | 16 ++++++++++++++++ .github/workflows/lint.yml | 2 +- .github/workflows/publish-docs.yml | 2 +- .github/workflows/test-code.yml | 2 +- .github/workflows/test-docs.yml | 2 +- 6 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 .github/actions/install-pkg/action.yml create mode 100644 .github/actions/render-docs/action.yml diff --git a/.github/actions/install-pkg/action.yml b/.github/actions/install-pkg/action.yml new file mode 100644 index 00000000..268c9d26 --- /dev/null +++ b/.github/actions/install-pkg/action.yml @@ -0,0 +1,16 @@ +name: install pkg + +runs: + using: composite + steps: + - uses: actions/setup-python@v5 + with: + python-version: '3.8' + cache: 'pip' + - run: | + set -e + pip install -r requirements.txt + pip install -r tests/requirements.txt + pip install -r docs/requirements.txt + pip install . + shell: bash diff --git a/.github/actions/render-docs/action.yml b/.github/actions/render-docs/action.yml new file mode 100644 index 00000000..2706c312 --- /dev/null +++ b/.github/actions/render-docs/action.yml @@ -0,0 +1,16 @@ +name: render docs + +runs: + using: composite + steps: + - uses: nikeee/setup-pandoc@v1 + - uses: quarto-dev/quarto-actions/setup@v2.0.3 + with: + fetch-depth: 0 + - name: Render Quarto docs + run: python src/odm_validation/tools/render_quarto_docs.py + - name: Build and Commit + uses: sphinx-notes/pages@2.1 # requires checkout with `fetch-depth: 0` + with: + documentation_path: docs + target_branch: gh-pages diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 55c518b2..4e6a6009 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: flake8 Lint +name: lint code on: [pull_request] diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 0d2b9ee0..0542a160 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -1,4 +1,4 @@ -name: Generate docs and push to Github Pages +name: publish docs on: push: diff --git a/.github/workflows/test-code.yml b/.github/workflows/test-code.yml index c6d216f7..c614c9a6 100644 --- a/.github/workflows/test-code.yml +++ b/.github/workflows/test-code.yml @@ -1,4 +1,4 @@ -name: Test code +name: test code on: [pull_request] diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml index a2a1e89c..8dc6a852 100644 --- a/.github/workflows/test-docs.yml +++ b/.github/workflows/test-docs.yml @@ -1,4 +1,4 @@ -name: test documentation generation +name: test doc generation on: pull_request: From 26e86e25e21faff022b2b65afb020687bbb2f409 Mon Sep 17 00:00:00 2001 From: zargot Date: Mon, 2 Dec 2024 17:35:26 -0500 Subject: [PATCH 08/11] work --- .github/actions/render-docs/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/render-docs/action.yml b/.github/actions/render-docs/action.yml index 2706c312..fc9afc55 100644 --- a/.github/actions/render-docs/action.yml +++ b/.github/actions/render-docs/action.yml @@ -9,6 +9,7 @@ runs: fetch-depth: 0 - name: Render Quarto docs run: python src/odm_validation/tools/render_quarto_docs.py + shell: bash - name: Build and Commit uses: sphinx-notes/pages@2.1 # requires checkout with `fetch-depth: 0` with: From 4763ab8d7366aae4a13fd4b4bc9df136cb763c77 Mon Sep 17 00:00:00 2001 From: zargot Date: Mon, 2 Dec 2024 17:51:51 -0500 Subject: [PATCH 09/11] work --- .github/workflows/publish-docs.yml | 2 ++ .github/workflows/test-docs.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 0542a160..e3d4d362 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -17,6 +17,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - uses: ./.github/actions/install-pkg - uses: ./.github/actions/render-docs - name: Set GH-Pages domain name diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml index 8dc6a852..359cac49 100644 --- a/.github/workflows/test-docs.yml +++ b/.github/workflows/test-docs.yml @@ -15,5 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - uses: ./.github/actions/install-pkg - uses: ./.github/actions/render-docs From 3be0141d08ebed0de0c51156d7a2aacb04b207df Mon Sep 17 00:00:00 2001 From: zargot Date: Mon, 2 Dec 2024 18:03:50 -0500 Subject: [PATCH 10/11] work --- .github/workflows/test-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml index 359cac49..d7cd7044 100644 --- a/.github/workflows/test-docs.yml +++ b/.github/workflows/test-docs.yml @@ -17,5 +17,5 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: ./.github/actions/install-pkg - - uses: ./.github/actions/render-docs + - uses: ./.github/actions/install-pkg/ + - uses: ./.github/actions/render-docs/ From 4665f59d21d4ffc6cd2259a73740ef98f771a9db Mon Sep 17 00:00:00 2001 From: zargot Date: Mon, 2 Dec 2024 18:07:28 -0500 Subject: [PATCH 11/11] work --- .github/workflows/test-docs.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml index d7cd7044..8791929c 100644 --- a/.github/workflows/test-docs.yml +++ b/.github/workflows/test-docs.yml @@ -15,7 +15,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - with: - fetch-depth: 0 - uses: ./.github/actions/install-pkg/ - uses: ./.github/actions/render-docs/