Adjust ingress expiry to not be more than 5 min after the consent message #2649
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI Checks | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
formatting: | |
runs-on: ubuntu-20.04 | |
# In order to trigger the CLA after committing formatting changes, we need | |
# to use the GIX_CREATE_PR_PAT token. This token is not available for all | |
# users. So on PRs where the token is not available, we don't commit | |
# changes and instead just fail if the formatting is incorrect. | |
steps: | |
- name: Check if personal access token is available | |
id: check_pat | |
run: | | |
echo "has_pat=${{ secrets.GIX_CREATE_PR_PAT != '' }}" >> $GITHUB_OUTPUT | |
- name: Checkout | |
if: steps.check_pat.outputs.has_pat == 'true' | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.GIX_CREATE_PR_PAT }} | |
- name: Checkout without personal access token | |
if: steps.check_pat.outputs.has_pat == 'false' | |
uses: actions/checkout@v2 | |
- name: Install shfmt | |
run: sudo snap install --classic shfmt | |
- name: Format shell scripts | |
run: ./scripts/fmt-sh | |
- name: Install ts dependencies | |
run: npm ci | |
- name: Format ts | |
run: npm run format | |
- name: Check formatting changes | |
id: check_format | |
run: | | |
if git diff --exit-code; then | |
echo "formatting_needed=false" >> $GITHUB_OUTPUT | |
else | |
echo "formatting_needed=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Commit Formatting changes | |
if: steps.check_pat.outputs.has_pat == 'true' && steps.check_format.outputs.formatting_needed == 'true' | |
uses: EndBug/add-and-commit@v7.2.0 | |
with: | |
add: . | |
default_author: github_actions | |
message: "Updating formatting" | |
# do not pull: if this branch is behind, then we might as well let | |
# the pushing fail | |
pull_strategy: "NO-PULL" | |
- name: Fail for formatting issues without personal access token | |
if: steps.check_pat.outputs.has_pat == 'false' && steps.check_format.outputs.formatting_needed == 'true' | |
run: | | |
echo "Formatting changes are needed but couldn't be committed because the personal access token isn't available." | |
exit 1 | |
build-candid: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install didc | |
run: | | |
mkdir -p .bin | |
curl -L https://github.com/dfinity/candid/releases/download/2024-02-27/didc-linux64 > .bin/didc | |
chmod +x .bin/didc | |
- name: Add didc to the PATH | |
run: echo "${PWD}/.bin" >> $GITHUB_PATH | |
- name: Install ts dependencies | |
run: npm ci --include=dev | |
- name: Compile candid | |
run: ./scripts/compile-idl-js | |
- name: Verify that there are no changes to the compiled did files | |
run: git diff --exit-code -- candid/ | |
build-protobuf: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Check the protoc installer | |
run: ./scripts/install-protoc --help | |
- name: Install protoc | |
run: sudo ./scripts/install-protoc | |
- name: Install ts dependencies | |
run: npm ci --include=dev | |
- name: Compile protobuf | |
run: npm run protoc | |
- name: Verify that there are no changes to the compiled proto files | |
run: git diff --exit-code -- packages/nns/proto/ | |
build: | |
needs: [build-candid, build-protobuf] | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build --workspaces | |
lint: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: npm ci | |
- name: Lint | |
run: npm run lint | |
test: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build --workspaces | |
- name: Test | |
run: npm run test --workspaces | |
size: | |
runs-on: ubuntu-20.04 | |
# The size checker should run and provide metrics only on PRs | |
if: ${{ github.ref != 'refs/heads/main' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Size check | |
uses: andresz1/size-limit-action@v1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
may-merge: | |
needs: ["formatting", "build", "lint", "test", "size"] | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Cleared for merging | |
run: echo OK |