From 36b378d3fcda05ec85bfa12f0234a0b4462eb8c5 Mon Sep 17 00:00:00 2001 From: martincostello Date: Tue, 28 Nov 2023 17:11:08 +0000 Subject: [PATCH 1/4] Compile for arm64 in GitHub Actions Cross-architecture compile for arm64 on GitHub Actions' ubuntu-latest hosted runner. See https://learn.microsoft.com/dotnet/core/deploying/native-aot/cross-compile#linux. Effectively a revert of #973. --- .dockerignore | 26 -------------------------- .github/dependabot.yml | 8 -------- .github/workflows/build.yml | 15 +++++++++++++++ Dockerfile | 18 ------------------ build.ps1 | 2 +- 5 files changed, 16 insertions(+), 53 deletions(-) delete mode 100644 .dockerignore delete mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index cb71a42f..00000000 --- a/.dockerignore +++ /dev/null @@ -1,26 +0,0 @@ -**/.DS_Store -**/.dockerignore -**/.env -**/.git -**/.gitignore -**/.project -**/.settings -**/.toolstarget -**/.vs -**/.vscode -**/*.*proj.user -**/*.dbmdl -**/artifacts -**/bin -**/charts -**/docker-compose* -**/compose* -**/Dockerfile* -**/obj -**/secrets.dev.yaml -**/values.dev.yaml -LICENSE -README.md -!.git/HEAD -!.git/config -!.git/refs/heads/ diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 35488cd4..7f2f1b2f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,13 +1,5 @@ version: 2 updates: -- package-ecosystem: docker - directory: "/" - schedule: - interval: daily - time: "05:30" - timezone: Europe/London - reviewers: - - "martincostello" - package-ecosystem: "github-actions" directory: "/" schedule: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2cc6104f..e0ac8ee6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,6 +52,21 @@ jobs: steps: + - name: Setup arm64 support for native AoT + if: runner.os == 'Linux' + shell: bash + run: | + dpkg --add-architecture arm64 + bash -c 'cat > /etc/apt/sources.list.d/arm64.list < Date: Tue, 28 Nov 2023 17:13:49 +0000 Subject: [PATCH 2/4] Add sudo I assumed that `sudo` wouldn't be needed on GitHub Actions, but I appear to be wrong. --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e0ac8ee6..5d0575f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,16 +56,16 @@ jobs: if: runner.os == 'Linux' shell: bash run: | - dpkg --add-architecture arm64 - bash -c 'cat > /etc/apt/sources.list.d/arm64.list < /etc/apt/sources.list.d/arm64.list < Date: Tue, 28 Nov 2023 17:16:39 +0000 Subject: [PATCH 3/4] Remove Docker build Forgot to remove in 36b378d3fcda05ec85bfa12f0234a0b4462eb8c5. --- .github/workflows/build.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d0575f7..6099a78f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -83,11 +83,6 @@ jobs: file: ./artifacts/coverage/coverage.cobertura.xml flags: ${{ matrix.os_name }} - - name: Build for arm64 with Docker - if: runner.os == 'Linux' - run: | - docker build --platform linux/arm64 --output . . - - name: Publish artifacts uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: From e2cf88453dae6240c479eb10df7c402340a053ee Mon Sep 17 00:00:00 2001 From: martincostello Date: Tue, 28 Nov 2023 17:17:10 +0000 Subject: [PATCH 4/4] Specify shell Explicitly specify using bash as the shell where appropriate. --- .github/workflows/build.yml | 11 +++++++++++ .github/workflows/deploy.yml | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6099a78f..db675b83 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,6 +91,7 @@ jobs: - name: Create Lambda ZIP file if: runner.os == 'Linux' + shell: bash run: | cd "./artifacts/publish/LondonTravel.Skill/release_linux-arm64" || exit if [ -f "./bootstrap" ] @@ -125,6 +126,7 @@ jobs: steps: - name: Set function name + shell: bash run: | echo "FUNCTION_NAME=${LAMBDA_FUNCTION}-dev" >> "$GITHUB_ENV" @@ -153,6 +155,7 @@ jobs: aws-region: ${{ env.AWS_REGION }} - name: Update function code + shell: bash run: | aws lambda update-function-code \ --function-name "${FUNCTION_NAME}" \ @@ -161,12 +164,14 @@ jobs: > /dev/null - name: Wait for function code update + shell: bash run: | aws lambda wait function-updated-v2 \ --function-name "${FUNCTION_NAME}" \ > /dev/null - name: Update function configuration + shell: bash run: | aws lambda update-function-configuration \ --function-name "${FUNCTION_NAME}" \ @@ -179,6 +184,7 @@ jobs: > /dev/null - name: Wait for function configuration update + shell: bash run: | aws lambda wait function-updated-v2 \ --function-name "${FUNCTION_NAME}" \ @@ -229,6 +235,7 @@ jobs: steps: - name: Set function name + shell: bash run: | echo "FUNCTION_NAME=${LAMBDA_FUNCTION}" >> "$GITHUB_ENV" @@ -257,6 +264,7 @@ jobs: aws-region: ${{ env.AWS_REGION }} - name: Update function code + shell: bash run: | aws lambda update-function-code \ --function-name "${FUNCTION_NAME}" \ @@ -265,12 +273,14 @@ jobs: > /dev/null - name: Wait for function code update + shell: bash run: | aws lambda wait function-updated-v2 \ --function-name "${FUNCTION_NAME}" \ > /dev/null - name: Update function configuration + shell: bash run: | aws lambda update-function-configuration \ --function-name "${FUNCTION_NAME}" \ @@ -283,6 +293,7 @@ jobs: > /dev/null - name: Wait for function configuration update + shell: bash run: | aws lambda wait function-updated-v2 \ --function-name "${FUNCTION_NAME}" \ diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4011a827..47b21e08 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -162,6 +162,7 @@ jobs: env: ARTIFACT_PATH: ${{ steps.download-artifact.outputs.zip-path }} STAGING_PATH: '${{ github.workspace }}/staging' + shell: bash run: | mkdir --parents "${STAGING_PATH}" unzip -q "${ARTIFACT_PATH}" -d "${STAGING_PATH}" @@ -181,6 +182,7 @@ jobs: LAMBDA_ARTIFACT_REF: ${{ steps.download-artifact.outputs.ref }} LAMBDA_ARTIFACT_RUN_NUMBER: ${{ steps.download-artifact.outputs.run-number }} LAMBDA_ENVIRONMENT: ${{ steps.get-environment-name.outputs.result }} + shell: bash run: | environment_name="${LAMBDA_ENVIRONMENT}" lambda_config="$(unzip -p "${LAMBDA_ARTIFACT_PATH}/${LAMBDA_FUNCTION}.zip" aws-lambda-tools-defaults.json)" @@ -279,6 +281,7 @@ jobs: aws-region: ${{ env.AWS_REGION }} - name: Update function code + shell: bash run: | aws lambda update-function-code \ --function-name "${FUNCTION_NAME}" \ @@ -287,12 +290,14 @@ jobs: > /dev/null - name: Wait for function code update + shell: bash run: | aws lambda wait function-updated-v2 \ --function-name "${FUNCTION_NAME}" \ > /dev/null - name: Update function configuration + shell: bash run: | aws lambda update-function-configuration \ --function-name "${FUNCTION_NAME}" \ @@ -305,6 +310,7 @@ jobs: > /dev/null - name: Wait for function configuration update + shell: bash run: | aws lambda wait function-updated-v2 \ --function-name "${FUNCTION_NAME}" \