Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekleog-NEAR committed Nov 20, 2023
2 parents a1c1976 + 65fa82c commit 3908c6f
Show file tree
Hide file tree
Showing 165 changed files with 1,477 additions and 1,040 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ jobs:
run_integ_tests: false
timeout-minutes: 90
steps:
# Some of the tests allocate really sparse maps, so heuristic-based overcommit limits are not
# appropriate here.
# FIXME(#9634): remove this once the issue is resolved.
- run: sudo sysctl vm.overcommit_memory=1 || true
- uses: actions/checkout@v4

# Install all the required tools
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/issue-metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Monthly issue metrics

on:
workflow_dispatch:
schedule:
- cron: '3 2 1 * *'

permissions:
issues: write

jobs:
monthly-issue-metrics:
name: past month issue metrics
runs-on: ubuntu-latest
steps:
- name: Get dates for last month
shell: bash
id: last-month
run: |
# Calculate the first day of the previous month
first_day=$(date -d "last month" +%Y-%m-01)
# Calculate the last day of the previous month
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)
#Set an environment variable with the date range
echo "$first_day..$last_day"
echo "LAST_MONTH=$first_day..$last_day" >> $GITHUB_OUTPUT
- name: Run issue-metrics tool
uses: github/issue-metrics@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'repo:near/nearcore is:issue created:${{ steps.last-month.outputs.LAST_MONTH }}'

- name: Create issue
uses: peter-evans/create-issue-from-file@v4
with:
title: Monthly issue metrics report
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./issue_metrics.md
5 changes: 3 additions & 2 deletions .github/workflows/master_fuzzer_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ jobs:
with:
crate: cargo-bolero
# TODO: remove the below once https://github.com/camshaft/bolero/pull/195 is released on crates.io
git: https://github.com/camshaft/bolero
rev: 8c5a50a57b0e4c4cc8111cfd95670dc75cd2dea7
# and https://github.com/camshaft/bolero/pull/196 has a proper fix
git: https://github.com/Ekleog-NEAR/bolero
rev: 8f4e49d65c702a2f9858ed3c217b1cb52ce91243

- run: rustup target add --toolchain nightly wasm32-unknown-unknown

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/neard_assertion_binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
jobs:
binary-release:
name: "Build and publish neard binary"
runs-on: "ubuntu-22.04-16core"
runs-on: "ubuntu-20.04-16core"
environment: deploy
permissions:
id-token: write # required to use OIDC authentication
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/neard_nightly_binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
binary-release:
name: "Build and publish neard binary"
runs-on: "ubuntu-22.04-16core"
runs-on: "ubuntu-20.04-16core"
environment: deploy
permissions:
id-token: write # required to use OIDC authentication
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Neard Linux binary release
name: Neard binary and Docker image release

on:
# Run when a new release or rc is created
Expand All @@ -18,7 +18,7 @@ on:
jobs:
binary-release:
name: "Build and publish neard binary"
runs-on: "ubuntu-22.04-16core"
runs-on: "ubuntu-20.04-16core"
environment: deploy
permissions:
id-token: write # required to use OIDC authentication
Expand All @@ -39,8 +39,6 @@ jobs:
- name: Checkout nearcore repository
if: ${{ github.event_name != 'workflow_dispatch'}}
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}

- name: Neard binary build and upload to S3
run: ./scripts/binary_release.sh
Expand All @@ -50,3 +48,41 @@ jobs:
echo $(git rev-parse HEAD) > latest
BRANCH=$(git branch --show-current)
aws s3 cp --acl public-read latest s3://build.nearprotocol.com/nearcore/$(uname)/${BRANCH}/latest
docker-release:
name: "Build and publish nearcore Docker image"
runs-on: "ubuntu-20.04-16core"
environment: deploy
steps:
- name: Checkout ${{ github.event.inputs.branch }} branch
if: ${{ github.event_name == 'workflow_dispatch'}}
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}

- name: Checkout nearcore repository
if: ${{ github.event_name != 'workflow_dispatch'}}
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKER_PAT_TOKEN }}

- name: Build and push Docker image to Dockerhub
run: |
COMMIT=$(git rev-parse HEAD)
BRANCH=${{ github.ref_name }}
make docker-nearcore
docker tag nearcore nearprotocol/nearcore:${BRANCH}-${COMMIT}
docker tag nearcore nearprotocol/nearcore:${BRANCH}
docker push nearprotocol/nearcore:${BRANCH}-${COMMIT}
docker push nearprotocol/nearcore:${BRANCH}
if [[ ${BRANCH} == "master" ]];
then
docker tag nearcore nearprotocol/nearcore:latest
docker push nearprotocol/nearcore:latest
fi
7 changes: 4 additions & 3 deletions .github/workflows/ondemand_fuzzer_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ jobs:
- uses: baptiste0928/cargo-install@21a18ba3bf4a184d1804e8b759930d3471b1c941
with:
crate: cargo-bolero
# TODO: remove the below once https://github.com/camshaft/bolero/pull/195 lands
git: https://github.com/camshaft/bolero
rev: 8c5a50a57b0e4c4cc8111cfd95670dc75cd2dea7
# TODO: remove the below once https://github.com/camshaft/bolero/pull/195 is released on crates.io
# and https://github.com/camshaft/bolero/pull/196 has a proper fix
git: https://github.com/Ekleog-NEAR/bolero
rev: 8f4e49d65c702a2f9858ed3c217b1cb52ce91243

- run: rustup target add --toolchain nightly wasm32-unknown-unknown

Expand Down
Loading

0 comments on commit 3908c6f

Please sign in to comment.