Skip to content

Commit

Permalink
Update actions to fix warnings on deploy (#1752)
Browse files Browse the repository at this point in the history
* Update actions to fix warnings on deploy
* fix references to build output
* Update version of setup-python for CI/CD
* Update versions of actions for backend CI/CD tests
* Update setting of $GITHUB_OUTPUT
* Update frontend, python tests
* Update python configs
  • Loading branch information
jmgrady authored Nov 2, 2022
1 parent 5d8e328 commit 511e0b2
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 23 deletions.
11 changes: 7 additions & 4 deletions .github/actions/combine-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ runs:

- name: Save Image Tag
id: save_image_tag
run: echo "::set-output name=image_tag::${{ env.IMAGE_TAG }}"
run: echo "image_tag=${{ env.IMAGE_TAG }}" >> $GITHUB_OUTPUT
shell: bash

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ inputs.aws_access_key_id }}
aws-secret-access-key: ${{ inputs.aws_secret_access_key }}
Expand All @@ -55,6 +55,9 @@ runs:
password: ${{ inputs.aws_secret_access_key }}

- name: Build The Combine
run: |
deploy/scripts/build.py --tag ${{ env.IMAGE_TAG }} --repo ${{ inputs.image_registry }}${{ inputs.image_registry_alias}}
run: >
deploy/scripts/build.py
--components ${{ inputs.build_component }}
--tag ${{ env.IMAGE_TAG }}
--repo ${{ inputs.image_registry }}${{ inputs.image_registry_alias}}
shell: bash
12 changes: 6 additions & 6 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet }}

# Coverage.
- run: dotnet test Backend.Tests/Backend.Tests.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
- name: Upload coverage report
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
files: Backend.Tests/coverage.cobertura.xml
flags: backend
Expand All @@ -47,23 +47,23 @@ jobs:
# Manually install .NET to work around:
# https://github.com/github/codeql-action/issues/757
- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: "6.0.x"
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: csharp
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2
- name: Upload artifacts if build failed
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: tracer-logs
path: ${{ runner.temp }}/*.log
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2

docker_build:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/combine_deploy_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy_qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Remove old AWS ECR images
run: scripts/clean_aws_repo.py combine_frontend combine_backend combine_maint --keep ${{ needs.build.outputs.image_tag }} --remove "${{ env.RM_PATTERN_1 }}" "${{ env.RM_PATTERN_2 }}" --verbose
run: scripts/clean_aws_repo.py combine_frontend combine_backend combine_maint combine_database --keep ${{ needs.build.outputs.image_tag }} --remove "${{ env.RM_PATTERN_1 }}" "${{ env.RM_PATTERN_2 }}" --verbose
deploy_update:
needs: build
runs-on: [self-hosted, thecombine]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.14]
node-version: [16]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
Expand All @@ -27,7 +27,7 @@ jobs:
env:
CI: true
- name: Upload coverage report
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
files: coverage/clover.xml
flags: frontend
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# User guide build environment.
FROM python:3.9 AS user_guide_builder
FROM python:3.10 AS user_guide_builder

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
Expand All @@ -16,7 +16,7 @@ COPY docs/user_guide docs/user_guide
RUN tox -e user-guide

# Frontend build environment.
FROM node:16.14 AS frontend_builder
FROM node:16 AS frontend_builder
WORKDIR /app

# Install app dependencies.
Expand All @@ -28,7 +28,7 @@ COPY . ./
RUN npm run build

# Production environment.
FROM nginx:1.21
FROM nginx:1.23

WORKDIR /app

Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ extend-exclude =
# tox-gh-actions configuration.
[gh-actions]
python =
3.9: lint, fmt-check, type-check, user-guide
3.10: lint
3.8: lint
3.9: lint
3.10: lint, fmt-check, type-check, user-guide

[tox]
envlist =
Expand Down

0 comments on commit 511e0b2

Please sign in to comment.