-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
553 additions
and
31 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,279 @@ | ||
# SPDX-License-Identifier: ice License 1.0 | ||
|
||
name: CI/CD | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
verify-licensing: | ||
name: Verify Licensing | ||
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || github.event_name == 'push' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Find latest Go Version | ||
id: findLatestGoVersion | ||
run: | | ||
LATEST_GO_VERSION=$(make latestGoVersion) | ||
echo "::set-output name=latestGoVersion::$LATEST_GO_VERSION" | ||
- name: Setup GO | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ steps.findLatestGoVersion.outputs.latestGoVersion }} | ||
- name: Check License | ||
run: make checkLicense | ||
- name: Slack Notification For Failure/Cancellation | ||
if: ${{ github.event_name == 'push' && (failure() || cancelled()) }} | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.BACKEND_SLACK_WEBHOOK }} | ||
SLACK_TITLE: CI Failed> ${{ job.status }} | ||
SLACK_USERNAME: ${{ github.event.repository.name }}-ci-bot | ||
SLACK_ICON: https://avatars.githubusercontent.com/u/102382658?s=400&u=62e73f4cb845c48a07a19e03c6f84b721e40c0a6&v=4 | ||
SLACK_ICON_EMOJI: ':sob:' | ||
SLACK_COLOR: ${{ job.status }} | ||
SLACK_FOOTER: | | ||
https://github.com/ice-blockchain/${{ github.event.repository.name }} | ||
verify-latest-versions-used: | ||
name: Verify Latest Versions | ||
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || github.event_name == 'push' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Find latest Go Version | ||
id: findLatestGoVersion | ||
run: | | ||
LATEST_GO_VERSION=$(make latestGoVersion) | ||
echo "::set-output name=latestGoVersion::$LATEST_GO_VERSION" | ||
- name: Setup GO | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ steps.findLatestGoVersion.outputs.latestGoVersion }} | ||
- name: Check If We're Up to Date with Everything | ||
run: make checkModVersion checkIfAllDependenciesAreUpToDate | ||
- name: Slack Notification For Failure/Cancellation | ||
if: ${{ github.event_name == 'push' && (failure() || cancelled()) }} | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.BACKEND_SLACK_WEBHOOK }} | ||
SLACK_TITLE: CI Failed> ${{ job.status }} | ||
SLACK_USERNAME: ${{ github.event.repository.name }}-ci-bot | ||
SLACK_ICON: https://avatars.githubusercontent.com/u/102382658?s=400&u=62e73f4cb845c48a07a19e03c6f84b721e40c0a6&v=4 | ||
SLACK_ICON_EMOJI: ':sob:' | ||
SLACK_COLOR: ${{ job.status }} | ||
SLACK_FOOTER: | | ||
https://github.com/ice-blockchain/${{ github.event.repository.name }} | ||
verify-auto-generated: | ||
name: Verify Auto Generated | ||
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || github.event_name == 'push' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Find latest Go Version | ||
id: findLatestGoVersion | ||
run: | | ||
LATEST_GO_VERSION=$(make latestGoVersion) | ||
echo "::set-output name=latestGoVersion::$LATEST_GO_VERSION" | ||
- name: Setup GO | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ steps.findLatestGoVersion.outputs.latestGoVersion }} | ||
- name: Check Auto Generated Files | ||
run: make checkGenerated | ||
- name: Slack Notification For Failure/Cancellation | ||
if: ${{ github.event_name == 'push' && (failure() || cancelled()) }} | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.BACKEND_SLACK_WEBHOOK }} | ||
SLACK_TITLE: CI Failed> ${{ job.status }} | ||
SLACK_USERNAME: ${{ github.event.repository.name }}-ci-bot | ||
SLACK_ICON: https://avatars.githubusercontent.com/u/102382658?s=400&u=62e73f4cb845c48a07a19e03c6f84b721e40c0a6&v=4 | ||
SLACK_ICON_EMOJI: ':sob:' | ||
SLACK_COLOR: ${{ job.status }} | ||
SLACK_FOOTER: | | ||
https://github.com/ice-blockchain/${{ github.event.repository.name }} | ||
lint: | ||
name: Lint | ||
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || github.event_name == 'push' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Find latest Go Version | ||
id: findLatestGoVersion | ||
run: | | ||
LATEST_GO_VERSION=$(make latestGoVersion) | ||
echo "::set-output name=latestGoVersion::$LATEST_GO_VERSION" | ||
- name: Setup GO | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ steps.findLatestGoVersion.outputs.latestGoVersion }} | ||
# # # # # TODO Setup linting | ||
# - name: golangci-lint | ||
# uses: golangci/golangci-lint-action@v3 | ||
# with: | ||
# version: latest | ||
- name: Slack Notification For Failure/Cancellation | ||
if: ${{ github.event_name == 'push' && (failure() || cancelled()) }} | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.BACKEND_SLACK_WEBHOOK }} | ||
SLACK_TITLE: CI Failed> ${{ job.status }} | ||
SLACK_USERNAME: ${{ github.event.repository.name }}-ci-bot | ||
SLACK_ICON: https://avatars.githubusercontent.com/u/102382658?s=400&u=62e73f4cb845c48a07a19e03c6f84b721e40c0a6&v=4 | ||
SLACK_ICON_EMOJI: ':sob:' | ||
SLACK_COLOR: ${{ job.status }} | ||
SLACK_FOOTER: | | ||
https://github.com/ice-blockchain/${{ github.event.repository.name }} | ||
build: | ||
name: Build | ||
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || github.event_name == 'push' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Find latest Go Version | ||
id: findLatestGoVersion | ||
run: | | ||
LATEST_GO_VERSION=$(make latestGoVersion) | ||
echo "::set-output name=latestGoVersion::$LATEST_GO_VERSION" | ||
- name: Setup GO | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ steps.findLatestGoVersion.outputs.latestGoVersion }} | ||
- name: Build all | ||
run: make build-all@ci/cd | ||
- name: Slack Notification For Failure/Cancellation | ||
if: ${{ github.event_name == 'push' && (failure() || cancelled()) }} | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.BACKEND_SLACK_WEBHOOK }} | ||
SLACK_TITLE: CI Failed> ${{ job.status }} | ||
SLACK_USERNAME: ${{ github.event.repository.name }}-ci-bot | ||
SLACK_ICON: https://avatars.githubusercontent.com/u/102382658?s=400&u=62e73f4cb845c48a07a19e03c6f84b721e40c0a6&v=4 | ||
SLACK_ICON_EMOJI: ':sob:' | ||
SLACK_COLOR: ${{ job.status }} | ||
SLACK_FOOTER: | | ||
https://github.com/ice-blockchain/${{ github.event.repository.name }} | ||
test: | ||
name: Test | ||
strategy: | ||
matrix: | ||
package: [ "database/query", "server/http", "server/ws" ] | ||
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || github.event_name == 'push' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Find latest Go Version | ||
id: findLatestGoVersion | ||
run: | | ||
LATEST_GO_VERSION=$(make latestGoVersion) | ||
echo "::set-output name=latestGoVersion::$LATEST_GO_VERSION" | ||
- name: Setup GO | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ steps.findLatestGoVersion.outputs.latestGoVersion }} | ||
- name: Test ${{ matrix.package }} | ||
run: | | ||
#TODO enable coverage | ||
make -f ${{ github.workspace }}/Makefile test@ci/cd | ||
# make -f ${{ github.workspace }}/Makefile coverage | ||
- name: Slack Notification For Failure/Cancellation | ||
if: ${{ github.event_name == 'push' && (failure() || cancelled()) }} | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.BACKEND_SLACK_WEBHOOK }} | ||
SLACK_TITLE: CI Failed> ${{ job.status }} | ||
SLACK_USERNAME: ${{ github.event.repository.name }}-ci-bot | ||
SLACK_ICON: https://avatars.githubusercontent.com/u/102382658?s=400&u=62e73f4cb845c48a07a19e03c6f84b721e40c0a6&v=4 | ||
SLACK_ICON_EMOJI: ':sob:' | ||
SLACK_COLOR: ${{ job.status }} | ||
SLACK_FOOTER: | | ||
subzero/${{ matrix.package }} | ||
https://github.com/ice-blockchain/${{ github.event.repository.name }} | ||
benchmark: | ||
name: Benchmark | ||
strategy: | ||
matrix: | ||
package: [ "database/query", "server/http", "server/ws" ] | ||
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || github.event_name == 'push' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Find latest Go Version | ||
id: findLatestGoVersion | ||
run: | | ||
LATEST_GO_VERSION=$(make latestGoVersion) | ||
echo "::set-output name=latestGoVersion::$LATEST_GO_VERSION" | ||
- name: Setup GO | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ steps.findLatestGoVersion.outputs.latestGoVersion }} | ||
- name: Benchmark ${{ matrix.package }} | ||
run: | | ||
make -f ${{ github.workspace }}/Makefile benchmark@ci/cd | ||
- name: Slack Notification For Failure/Cancellation | ||
if: ${{ github.event_name == 'push' && (failure() || cancelled()) }} | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.BACKEND_SLACK_WEBHOOK }} | ||
SLACK_TITLE: CI Failed> ${{ job.status }} | ||
SLACK_USERNAME: ${{ github.event.repository.name }}-ci-bot | ||
SLACK_ICON: https://avatars.githubusercontent.com/u/102382658?s=400&u=62e73f4cb845c48a07a19e03c6f84b721e40c0a6&v=4 | ||
SLACK_ICON_EMOJI: ':sob:' | ||
SLACK_COLOR: ${{ job.status }} | ||
SLACK_FOOTER: | | ||
subzero/${{ matrix.package }} | ||
https://github.com/ice-blockchain/${{ github.event.repository.name }} | ||
PR: | ||
needs: [verify-licensing, verify-latest-versions-used, verify-auto-generated, lint, build, test, benchmark] | ||
name: PR | ||
if: ${{ always() && (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || github.event_name == 'push' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checking if all previous jobs were successful | ||
env: | ||
ALL_SUCCESSFUL: ${{ contains(join(needs.*.result, ','), 'failure') == false && contains(join(needs.*.result, ','), 'cancelled') == false && contains(join(needs.*.result, ','), 'skipped') == false }} | ||
run: | | ||
if [ $ALL_SUCCESSFUL == 'true' ] | ||
then | ||
exit 0 | ||
else | ||
exit 1 | ||
fi | ||
- name: Slack Notification For Failure/Cancellation | ||
if: ${{ github.event_name == 'push' && (failure() || cancelled()) }} | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.BACKEND_SLACK_WEBHOOK }} | ||
SLACK_TITLE: CI Failed> ${{ job.status }} | ||
SLACK_USERNAME: ${{ github.event.repository.name }}-ci-bot | ||
SLACK_ICON: https://avatars.githubusercontent.com/u/102382658?s=400&u=62e73f4cb845c48a07a19e03c6f84b721e40c0a6&v=4 | ||
SLACK_ICON_EMOJI: ':sob:' | ||
SLACK_COLOR: ${{ job.status }} | ||
SLACK_FOOTER: | | ||
https://github.com/ice-blockchain/${{ github.event.repository.name }} | ||
#TODO add release and trigger_deployment |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SPDX-License-Identifier: ice License 1.0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
ice License | ||
|
||
Version 1.0, January 2023 | ||
|
||
----------------------------------------------------------------------------- | ||
|
||
|
||
Licensor: ice Labs Limited | ||
|
||
Licensed Work: ice Network | ||
The Licensed Work is (c) 2023 ice Labs Limited | ||
|
||
----------------------------------------------------------------------------- | ||
|
||
|
||
Permission is hereby granted by the application Software Developer, ice Labs | ||
Limited, free of charge, to any person obtaining a copy of this application, | ||
software, and associated documentation files (the Software), which was | ||
developed by the Software Developer (ice Labs Limited) for use on ice Network | ||
whereby the purpose of this license is to permit the development of | ||
derivative works based on the Software, including the right to use, copy, | ||
modify, merge, publish, distribute, sub-license, and/or sell copies of such | ||
derivative works and any Software components incorporated therein, and to | ||
permit persons to whom such derivative works are furnished to do so, in each | ||
case, solely to develop, use, and market applications for the official ice | ||
Network. | ||
|
||
All Derivative Works developed under this License for use on the ice Network | ||
may only be released after the official launch of the ice Network’s Mainnet. | ||
|
||
For purposes of this license, ice Network shall mean any application, | ||
software, or another present or future platform developed, owned, or managed | ||
by ice Labs Limited, and its parents, affiliates, or subsidiaries. | ||
|
||
Disclaimer of Warranty. Unless required by applicable law or agreed to in | ||
writing, Licensor provides the Software on an "AS IS" BASIS, WITHOUT | ||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, | ||
without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, | ||
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely | ||
responsible for determining the appropriateness of using or redistributing | ||
the Software and assume any risks associated with Your exercise of | ||
permissions under this License. | ||
|
||
Limitation of Liability. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH | ||
THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. |
Oops, something went wrong.