Skip to content

Release: Changelog #18672

Release: Changelog

Release: Changelog #18672

Workflow file for this run

name: CI Checks
on:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -euxlo pipefail {0}
jobs:
formatting:
runs-on: ubuntu-20.04
env:
DFX_NETWORK: mainnet
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get node version
run: jq -r '"NODE_VERSION=\(.defaults.build.config.NODE_VERSION)"' dfx.json >> $GITHUB_ENV
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install shfmt
run: sudo snap install --classic shfmt
- name: Install yq
run: sudo snap install yq
- name: Format
run: ./scripts/fmt
- name: Check formatted
run: |
test -z "$(git status --porcelain)" || {
echo "FIX: Please run ./scripts/fmt"
git diff
exit 1
}
cargo-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-1
- name: Lint rust code
run: ./scripts/lint-rs
- name: Run Tests
shell: bash
run: |
cargo test --all-targets --all-features
env:
RUST_BACKTRACE: 1
svelte-tests:
runs-on: ubuntu-20.04
defaults:
run:
shell: bash
env:
DFX_NETWORK: mainnet
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get node version
run: jq -r '"NODE_VERSION=\(.defaults.build.config.NODE_VERSION)"' dfx.json >> $GITHUB_ENV
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: npm ci
working-directory: ./frontend
- name: Test
run: npm run test
working-directory: ./frontend
svelte-lint:
runs-on: ubuntu-20.04
defaults:
run:
shell: bash
env:
DFX_NETWORK: mainnet
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get node version
run: jq -r '"NODE_VERSION=\(.defaults.build.config.NODE_VERSION)"' dfx.json >> $GITHUB_ENV
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: npm ci
working-directory: ./frontend
- name: Run linter
run: npm run check
working-directory: ./frontend
e2e-lint:
runs-on: ubuntu-20.04
defaults:
run:
shell: bash
env:
DFX_NETWORK: mainnet
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get node version
run: jq -r '"NODE_VERSION=\(.defaults.build.config.NODE_VERSION)"' dfx.json >> $GITHUB_ENV
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dfx
run: DFX_VERSION="$(jq -r .dfx dfx.json)" sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
- name: Provide a config
run: ./config.sh
- name: Install dependencies
run: npm ci
working-directory: ./e2e-tests
- name: Run e2e linter
run: npm run lint
working-directory: ./e2e-tests
shell-checks:
name: ShellCheck
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
env:
SHELLCHECK_OPTS: -e SC1090 -e SC2119 -e SC1091
ic-commit-consistency:
name: IC Commit
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install didc
run: |
USER_BIN="$HOME/.local/bin"
mkdir -p "$USER_BIN"
echo "$USER_BIN" >> $GITHUB_PATH
curl -Lf https://github.com/dfinity/candid/releases/download/2022-11-17/didc-linux64 | install -m 755 /dev/stdin "$USER_BIN/didc"
- name: Check didc
run: command -v didc
- name: Run the ic_commit code generator
run: ./scripts/update_ic_commit --ic_commit "$(jq -re .defaults.build.config.IC_COMMIT dfx.json)"
- name: Verify that there are no code changes
run: |
if git diff | grep . ; then
echo "ERROR: The code is not consistent with the IC_COMMIT in dfx.json"
exit 1
fi
release-templating-works:
name: Release template
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install didc
run: |
USER_BIN="$HOME/.local/bin"
mkdir -p "$USER_BIN"
echo "$USER_BIN" >> $GITHUB_PATH
curl -Lf https://github.com/dfinity/candid/releases/download/2022-11-17/didc-linux64 | install -m 755 /dev/stdin "$USER_BIN/didc"
- name: Check didc
run: command -v didc
- name: Install dfx
run: DFX_VERSION="$(jq -r .dfx dfx.json)" sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
- name: Verify template creation
run: |
echo Create a fake wasm
mkdir -p release/ci
touch release/ci/nns-dapp.wasm
echo Create a proposal template
scripts/nns-dapp/release-template
echo Check the proposal
./scripts/nns-dapp/release-check
config-check:
name: Config check
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install tools
run: sudo apt-get update -yy && sudo apt-get install -yy moreutils
- name: Get SNS scripts
uses: actions/checkout@v3
with:
repository: 'dfinity/snsdemo'
path: 'snsdemo'
# Version from Apr 4 2023 with xz compressed state
ref: '8160f742e10fbd1ac89549a5880ae047ff8f290d'
- name: Add SNS scripts to the path
run: |
echo "$PWD/snsdemo/bin" >> $GITHUB_PATH
- name: Install tools
run: |
dfx-software-dfx-install --version "$(jq -r .dfx dfx.json)"
dfx-software-idl2json-install --version "v$(jq -r .defaults.build.config.IDL2JSON_VERSION dfx.json)"
- name: Check config script
run: bash -x ./config.test
checks-pass:
needs: ["formatting", "cargo-tests", "svelte-lint", "svelte-tests", "shell-checks", "e2e-lint", "ic-commit-consistency", "release-templating-works", "config-check"]
if: ${{ always() }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/needs_success
with:
needs: '${{ toJson(needs) }}'