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
26 changes: 5 additions & 21 deletions .github/workflows/activate-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ permissions:
jobs:
activate-stack:
name: Activate ${{ inputs.stack_name }} for ${{ inputs.environment }}
runs-on: [self-hosted, ci]
runs-on: codebuild-nhsd-nrlf-ci-build-project-${{ github.run_id }}-${{ github.run_attempt }}
environment: ${{ inputs.environment }}

steps:
Expand All @@ -32,18 +32,10 @@ jobs:
with:
ref: ${{ github.ref }}

- name: Setup asdf cache
uses: actions/cache@v4
with:
path: ~/.asdf
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
restore-keys: |
${{ runner.os }}-asdf-

- name: Install asdf
uses: asdf-vm/actions/install@v3.0.2
with:
asdf_branch: v0.13.1
- name: Setup environment
run: |
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
poetry install --no-root

- name: Configure Management Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand All @@ -52,14 +44,6 @@ jobs:
role-to-assume: ${{ secrets.MGMT_ROLE_ARN }}
role-session-name: github-actions-ci-${{ inputs.environment }}-${{ github.run_id}}

- name: Install zip
run: sudo apt-get install zip

- name: Setup Python environment
run: |
poetry install --no-root
source $(poetry env info --path)/bin/activate

- name: Get current environment config
run: |
poetry run python ./scripts/get_env_config.py all ${{ inputs.environment }}
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,7 @@ jobs:
run: make test

- name: Build Project
run: |
echo "PATH: ${PATH}"
echo "HOME: ${HOME}"
echo "python: $(which python)"
echo "asdf: $(which asdf)"
echo "/usr/local/bin: $(ls -la /usr/local/bin)"
make build
run: make build

- name: Configure Management Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand Down
152 changes: 28 additions & 124 deletions .github/workflows/persistent-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,18 @@ permissions:
jobs:
build:
name: Build - ${{ inputs.branch_name }}
runs-on: [self-hosted, ci]
runs-on: codebuild-nhsd-nrlf-ci-build-project-${{ github.run_id }}-${{ github.run_attempt }}

steps:
- name: Git clone - ${{ inputs.branch_name }}
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch_name }}

- name: Setup asdf cache
uses: actions/cache@v4
with:
path: ~/.asdf
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
restore-keys: |
${{ runner.os }}-asdf-

- name: Install asdf
uses: asdf-vm/actions/install@v3.0.2
with:
asdf_branch: v0.13.1

- name: Install zip
run: sudo apt-get install zip

- name: Setup Python environment
- name: Setup environment
run: |
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
poetry install --no-root
source $(poetry env info --path)/bin/activate

- name: Run Linting
run: make lint
Expand Down Expand Up @@ -91,26 +75,18 @@ jobs:
name: Terraform Plan - ${{ inputs.environment }}
needs: [build]
environment: ${{ inputs.environment }}
runs-on: [self-hosted, ci]
runs-on: codebuild-nhsd-nrlf-ci-build-project-${{ github.run_id }}-${{ github.run_attempt }}

steps:
- name: Git clone - ${{ inputs.branch_name }}
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch_name }}

- name: Setup asdf cache
uses: actions/cache@v4
with:
path: ~/.asdf
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
restore-keys: |
${{ runner.os }}-asdf-

- name: Install asdf
uses: asdf-vm/actions/install@v3.0.2
with:
asdf_branch: v0.13.1
- name: Setup environment
run: |
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
poetry install --no-root

- name: Configure Management Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand All @@ -130,14 +106,6 @@ jobs:
name: build-artifacts
path: dist

- name: Install zip
run: sudo apt-get install zip

- name: Setup Python environment
run: |
poetry install --no-root
source $(poetry env info --path)/bin/activate

- name: Restore NRLF permissions cache
uses: actions/cache/restore@v4
with:
Expand Down Expand Up @@ -170,7 +138,7 @@ jobs:
terraform-apply:
name: Terraform Apply - ${{ inputs.environment }}
needs: [terraform-plan]
runs-on: [self-hosted, ci]
runs-on: codebuild-nhsd-nrlf-ci-build-project-${{ github.run_id }}-${{ github.run_attempt }}
environment: ${{ inputs.environment }}

steps:
Expand All @@ -179,18 +147,10 @@ jobs:
with:
ref: ${{ inputs.branch_name }}

- name: Setup asdf cache
uses: actions/cache@v4
with:
path: ~/.asdf
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
restore-keys: |
${{ runner.os }}-asdf-

- name: Install asdf
uses: asdf-vm/actions/install@v3.0.2
with:
asdf_branch: v0.13.1
- name: Setup environment
run: |
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
poetry install --no-root

- name: Download build artifacts
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -220,14 +180,6 @@ jobs:
account=$(echo '${{ inputs.environment }}' | cut -d '-' -f1)
make truststore-pull-server ENV=${account}

- name: Install zip
run: sudo apt-get install zip

- name: Setup Python environment
run: |
poetry install --no-root
source $(poetry env info --path)/bin/activate

- name: Terraform Init
run: |
inactive_stack=$(poetry run python ./scripts/get_env_config.py inactive-stack ${{ inputs.environment }})
Expand All @@ -252,7 +204,7 @@ jobs:
activate-stack:
name: Activate - ${{ inputs.environment }}
needs: [terraform-apply]
runs-on: [self-hosted, ci]
runs-on: codebuild-nhsd-nrlf-ci-build-project-${{ github.run_id }}-${{ github.run_attempt }}
environment: ${{ inputs.environment }}

steps:
Expand All @@ -261,18 +213,10 @@ jobs:
with:
ref: ${{ inputs.branch_name }}

- name: Setup asdf cache
uses: actions/cache@v4
with:
path: ~/.asdf
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
restore-keys: |
${{ runner.os }}-asdf-

- name: Install asdf
uses: asdf-vm/actions/install@v3.0.2
with:
asdf_branch: v0.13.1
- name: Setup environment
run: |
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
poetry install --no-root

- name: Configure Management Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand All @@ -281,14 +225,6 @@ jobs:
role-to-assume: ${{ secrets.MGMT_ROLE_ARN }}
role-session-name: github-actions-ci-${{ inputs.environment }}-${{ github.run_id}}

- name: Install zip
run: sudo apt-get install zip

- name: Setup Python environment
run: |
poetry install --no-root
source $(poetry env info --path)/bin/activate

- name: Activate Stack
run: |
inactive_stack=$(poetry run python ./scripts/get_env_config.py inactive-stack ${{ inputs.environment }})
Expand All @@ -297,7 +233,7 @@ jobs:
post-release-verify:
name: Verify - ${{ inputs.environment }}
needs: [activate-stack]
runs-on: [self-hosted, ci]
runs-on: codebuild-nhsd-nrlf-ci-build-project-${{ github.run_id }}-${{ github.run_attempt }}
environment: ${{ inputs.environment }}

steps:
Expand All @@ -306,18 +242,10 @@ jobs:
with:
ref: ${{ inputs.branch_name }}

- name: Setup asdf cache
uses: actions/cache@v4
with:
path: ~/.asdf
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
restore-keys: |
${{ runner.os }}-asdf-

- name: Install asdf
uses: asdf-vm/actions/install@v3.0.2
with:
asdf_branch: v0.13.1
- name: Setup environment
run: |
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
poetry install --no-root

- name: Configure Management Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand All @@ -326,14 +254,6 @@ jobs:
role-to-assume: ${{ secrets.MGMT_ROLE_ARN }}
role-session-name: github-actions-ci-${{ inputs.environment }}-${{ github.run_id}}

- name: Install zip
run: sudo apt-get install zip

- name: Setup Python environment
run: |
poetry install --no-root
source $(poetry env info --path)/bin/activate

- name: "Smoke Test"
run: |
make ENV=${{ inputs.environment }} test-smoke-public
Expand All @@ -342,7 +262,7 @@ jobs:
name: Rollback - ${{ inputs.environment }}
needs: [post-release-verify]
if: always() && ( needs.post-release-verify.result == 'failure' )
runs-on: [self-hosted, ci]
runs-on: codebuild-nhsd-nrlf-ci-build-project-${{ github.run_id }}-${{ github.run_attempt }}
environment: ${{ inputs.environment }}

steps:
Expand All @@ -351,18 +271,10 @@ jobs:
with:
ref: ${{ inputs.branch_name }}

- name: Setup asdf cache
uses: actions/cache@v4
with:
path: ~/.asdf
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
restore-keys: |
${{ runner.os }}-asdf-

- name: Install asdf
uses: asdf-vm/actions/install@v3.0.2
with:
asdf_branch: v0.13.1
- name: Setup environment
run: |
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
poetry install --no-root

- name: Configure Management Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand All @@ -371,14 +283,6 @@ jobs:
role-to-assume: ${{ secrets.MGMT_ROLE_ARN }}
role-session-name: github-actions-ci-${{ inputs.environment }}-${{ github.run_id}}

- name: Install zip
run: sudo apt-get install zip

- name: Setup Python environment
run: |
poetry install --no-root
source $(poetry env info --path)/bin/activate

- name: Deactivate Stack
run: |
inactive_stack_name=$(poetry run python ./scripts/get_env_config.py inactive-stack ${{ inputs.environment }})
Expand Down
Loading
Loading