Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitallowed
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

token: \$\{\{ secrets.GITHUB_TOKEN \}\}
password="yes"
.*(GITHUB|SONAR)_TOKEN: \$\{\{ secrets.(GITHUB|SONAR)_TOKEN \}\}
.*asttokens = ">=2.1.0"
.*(GITHUB|SONAR|PYPI|TEST_PYPI)_TOKEN: \$\{\{ secrets.(GITHUB|SONAR|PYPI|TEST_PYPI)_TOKEN \}\}
.*asttokens = ">=2.1.0"
18 changes: 9 additions & 9 deletions .github/workflows/merge-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ permissions:
pull-requests: write

jobs:

coverage:
runs-on: ubuntu-latest
if: github.repository == 'NHSDigital/nhs-context-logging' && !contains(github.event.head_commit.message, 'tag release version:')
steps:
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand All @@ -26,7 +25,7 @@ jobs:
python-version: "3.8"

- name: setup poetry
uses: abatilo/actions-poetry@v4
uses: abatilo/actions-poetry@0dd19c9498c3dc8728967849d0d2eae428a8a3d8
with:
poetry-version: 1.5.1

Expand Down Expand Up @@ -60,7 +59,7 @@ jobs:

- name: setup java
if: github.actor != 'dependabot[bot]' && (success() || failure())
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: "corretto"
java-version: "17"
Expand All @@ -85,18 +84,17 @@ jobs:

- name: publish junit reports
if: success() || failure()
uses: mikepenz/action-junit-report@v5
uses: mikepenz/action-junit-report@3585e9575db828022551b4231f165eb59a0e74e3
with:
check_name: junit reports
report_paths: reports/junit/*.xml


publish:
runs-on: ubuntu-latest
if: github.repository == 'NHSDigital/nhs-context-logging' && github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, 'tag release version:')
steps:
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand All @@ -111,7 +109,7 @@ jobs:
python-version: "3.8"

- name: setup poetry
uses: abatilo/actions-poetry@v4
uses: abatilo/actions-poetry@0dd19c9498c3dc8728967849d0d2eae428a8a3d8
with:
poetry-version: 1.5.1

Expand Down Expand Up @@ -139,8 +137,10 @@ jobs:
release_name: ${{ env.RELEASE_VERSION }}

- name: poetry config
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry config pypi-token.pypi "${PYPI_TOKEN}"

- name: poetry publish
run: poetry publish
Expand Down
45 changes: 26 additions & 19 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
pull-requests: write

jobs:

tox:
strategy:
matrix:
Expand All @@ -20,7 +19,7 @@
if: github.repository == 'NHSDigital/nhs-context-logging'
steps:
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand All @@ -37,10 +36,12 @@
find . -type f | xargs chmod g+w
- name: merge into base_branch
env:
GITHUB_HEAD_REF: ${{ github.head_ref }}
if: ${{ github.event_name == 'pull_request' }}
run: |
echo base branch "${{ github.base_ref }}"
echo pr branch "${{ github.head_ref }}"
echo pr branch "${GITHUB_HEAD_REF}"
git checkout "${{ github.base_ref }}"
git checkout -b "merging-${{ github.event.number }}"
git merge --ff-only "${{ github.event.pull_request.head.sha }}"
Expand All @@ -56,13 +57,12 @@
- name: tox
run: tox


coverage:
runs-on: ubuntu-latest
if: github.repository == 'NHSDigital/nhs-context-logging'
steps:
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand All @@ -83,9 +83,11 @@

- name: merge into base_branch
if: ${{ github.event_name == 'pull_request' }}
env:
GITHUB_HEAD_REF: ${{ github.head_ref }}
run: |
echo base branch "${{ github.base_ref }}"
echo pr branch "${{ github.head_ref }}"
echo pr branch "${GITHUB_HEAD_REF}"
git checkout "${{ github.base_ref }}"
git checkout -b "merging-${{ github.event.number }}"
git merge --ff-only "${{ github.event.pull_request.head.sha }}"
Expand All @@ -96,7 +98,7 @@
python-version: "3.8"

- name: setup poetry
uses: abatilo/actions-poetry@v4
uses: abatilo/actions-poetry@0dd19c9498c3dc8728967849d0d2eae428a8a3d8
with:
poetry-version: 1.5.1

Expand Down Expand Up @@ -133,13 +135,13 @@

- name: setup java
if: github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork && (success() || failure())
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: "corretto"
java-version: "17"

- name: provision sonar-scanner
if: github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork && (success() || failure())
if: github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork && (success() || failure())
run: |
export SONAR_VERSION="4.7.0.2747"
wget -q "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_VERSION}.zip" -O sonar-scanner.zip
Expand All @@ -161,7 +163,6 @@
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}


- name: archive reports
if: github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork && (success() || failure())
uses: actions/upload-artifact@v4
Expand All @@ -171,7 +172,7 @@

- name: publish junit reports
if: success() || failure()
uses: mikepenz/action-junit-report@v5
uses: mikepenz/action-junit-report@3585e9575db828022551b4231f165eb59a0e74e3
with:
check_name: junit reports
report_paths: reports/junit/*.xml
Expand All @@ -181,7 +182,7 @@
if: github.repository == 'NHSDigital/nhs-context-logging'
steps:
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand All @@ -194,9 +195,11 @@

- name: merge into base_branch
if: ${{ github.event_name == 'pull_request' }}
env:
GITHUB_HEAD_REF: ${{ github.head_ref }}
run: |
echo base branch "${{ github.base_ref }}"
echo pr branch "${{ github.head_ref }}"
echo pr branch "${GITHUB_HEAD_REF}"
git checkout "${{ github.base_ref }}"
git checkout -b "merging-${{ github.event.number }}"
git merge --ff-only "${{ github.event.pull_request.head.sha }}"
Expand All @@ -207,7 +210,7 @@
python-version: "3.8"

- name: setup poetry
uses: abatilo/actions-poetry@v4
uses: abatilo/actions-poetry@0dd19c9498c3dc8728967849d0d2eae428a8a3d8
with:
poetry-version: 1.5.1

Expand Down Expand Up @@ -238,7 +241,7 @@
run: make mypy

- name: shellcheck
uses: ludeeus/action-shellcheck@master
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38
with:
ignore_paths: .venv build
ignore_names: git-secrets
Expand All @@ -260,7 +263,7 @@
- tox
steps:
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand All @@ -278,9 +281,11 @@
- name: merge into base_branch
if: ${{ github.event_name == 'pull_request' }}
env:
GITHUB_HEAD_REF: ${{ github.head_ref }}
run: |
echo base branch "${{ github.base_ref }}"
echo pr branch "${{ github.head_ref }}"
echo pr branch "${GITHUB_HEAD_REF}"
git checkout "${{ github.base_ref }}"
git checkout -b "merging-${{ github.event.number }}"
git merge --ff-only "${{ github.event.pull_request.head.sha }}"
Expand All @@ -291,7 +296,7 @@
python-version: "3.8"

- name: setup poetry
uses: abatilo/actions-poetry@v4
uses: abatilo/actions-poetry@0dd19c9498c3dc8728967849d0d2eae428a8a3d8
with:
poetry-version: 1.5.1

Expand All @@ -304,9 +309,11 @@
poetry build --format=wheel
- name: poetry config
env:
TEST_PYPI_TOKEN: ${{ secrets.TEST_PYPI_TOKEN }}
run: |
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_TOKEN }}
poetry config pypi-token.testpypi "${TEST_PYPI_TOKEN}"
- name: poetry test publish
run: poetry publish -r testpypi
Loading