Skip to content

Commit

Permalink
Combine small CI tests in a single job (#5181)
Browse files Browse the repository at this point in the history
# Motivation

We have a number of small bash scripts which are used to test something
on CI.
Currently each of these is run on a separate GitHub runner instance
which installs its own tools it needs.
This seems like overkill.

# Changes

1. Combined a number of jobs into a single `small-tests` job.
2. Run this job on both MacOS and Linux.

There are a few more small jobs that don't currently work on MacOS so I
didn't change them.

# Tests

See https://github.com/dfinity/nns-dapp/actions/runs/9892524481

# Todos

- [ ] Add entry to changelog (if necessary).
not necessary
  • Loading branch information
dskloetd authored Jul 11, 2024
1 parent b8f95ae commit f159c85
Showing 1 changed file with 42 additions and 99 deletions.
141 changes: 42 additions & 99 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,6 @@ jobs:
uses: dfinity/setup-dfx@main
- name: Test getting proposal args
run: scripts/dfx-nns-proposal-args.test
docker-build-cli-flags:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: docker-build prints help
run: ./scripts/docker-build --help | grep -i usage
minor-version-bump-works:
runs-on: ubuntu-20.04
steps:
Expand Down Expand Up @@ -284,88 +278,6 @@ jobs:
exit 1
} >&2
# TODO: Verify that the commits contain the expected changes.
download-nns-dapp-ci-wasm:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-13]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install bash and sha256sum if on Mac
run: |
if command -v brew ; then
brew install bash
brew install coreutils
fi
- name: Download NNS-dapp CI wasm
run: |
MAIN_COMMIT="$(git ls-remote --refs https://github.com/dfinity/nns-dapp.git main | awk '{print $1}')"
scripts/nns-dapp/download-ci-wasm.test --commit "$MAIN_COMMIT"
env:
GH_TOKEN: ${{ github.token }}
canister-ids-tool:
name: Test canister_ids tool
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-13]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install bash if on Mac
run: |
if command -v brew ; then
brew install bash
fi
- run: scripts/canister_ids.test
release-sop:
name: Test release-sop script
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-13]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install bash if on Mac
run: |
if command -v brew ; then
brew install bash
fi
- run: scripts/nns-dapp/release-sop.test
split-changelog:
name: Test split-changelog script
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-13]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install bash if on Mac
run: |
if command -v brew ; then
brew install bash
fi
- run: scripts/nns-dapp/split-changelog.test
unused-i18n:
name: Find unused i18n messages
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- run: scripts/unused-i18n
convert-id:
name: Test the ID conversion script
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install tools
run: |
# libarchive-zip-perl is needed for crc32, used by convert-id.
sudo apt-get update -yy && sudo apt-get install -yy libarchive-zip-perl
- name: Run test
run: scripts/convert-id.test
version-match:
name: The nns-dapp npm and cargo versions should match
runs-on: ubuntu-20.04
Expand All @@ -381,12 +293,48 @@ jobs:
echo "Frontend: $frontend_version"
exit 1
} >&2
network-config:
runs-on: ubuntu-20.04
small-tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-13]
runs-on: ${{ matrix.os }}
env:
# Used by download-ci-wasm.test
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
- name: Install sponge
run: sudo apt-get update -yy && sudo apt-get install -yy moreutils && command -v sponge
- name: Install tools on Linux
run: |
if command -v apt-get; then
# libarchive-zip-perl is needed for crc32, used by convert-id.test
sudo apt-get update -yy && sudo apt-get install -yy moreutils libarchive-zip-perl && command -v sponge
fi
- name: Install tools on Mac
run: |
if command -v brew ; then
# coreutils is needed for
# base32, used by convert-id.test, and
# sha256sum, used download-ci-wasm.test
# moreutils is needed for sponge, used by network-config.test
brew install bash coreutils moreutils
fi
- name: docker-build prints help
run: ./scripts/docker-build --help | grep -i usage
- name: Download NNS-dapp CI wasm
run: |
MAIN_COMMIT="$(git ls-remote --refs https://github.com/dfinity/nns-dapp.git main | awk '{print $1}')"
scripts/nns-dapp/download-ci-wasm.test --commit "$MAIN_COMMIT"
- name: Test canister_ids tool
run: scripts/canister_ids.test
- name: Test release-sop script
run: scripts/nns-dapp/release-sop.test
- name: Test split-changelog script
run: scripts/nns-dapp/split-changelog.test
- name: Find unused i18n messages
run: scripts/unused-i18n
- name: Test the ID conversion script
run: scripts/convert-id.test
- name: Getting network config works
run: scripts/network-config.test
checks-pass:
Expand All @@ -401,15 +349,10 @@ jobs:
- release-templating-works
- config-check
- asset-chunking-works
- docker-build-cli-flags
- download-nns-dapp-ci-wasm
- canister-ids-tool
- release-sop
- split-changelog
- minor-version-bump-works
- version-match
- network-config
- migration-test-utils-work
- version-match
- small-tests
if: ${{ always() }}
runs-on: ubuntu-20.04
steps:
Expand Down

0 comments on commit f159c85

Please sign in to comment.