diff --git a/.github/actions/restore-node/action.yml b/.github/actions/restore-node/action.yml index f8dc1b00cc9..b93feb5bf87 100644 --- a/.github/actions/restore-node/action.yml +++ b/.github/actions/restore-node/action.yml @@ -111,6 +111,10 @@ runs: shell: bash run: git config --global url."https://github.com/".insteadOf ssh://git@github.com/ + # Before setup-node because that action runs `yarn cache dir`. See https://github.com/actions/setup-node/issues/480#issuecomment-1915448139 + - run: corepack enable + shell: bash + - uses: actions/setup-node@v4 with: node-version: ${{ inputs.node-version }} @@ -122,9 +126,6 @@ runs: - uses: kenchan0130/actions-system-info@master id: system-info - - run: corepack enable - shell: bash - - name: restore built files id: built uses: actions/cache@v4 diff --git a/.github/workflow-templates/test-dapp.yml b/.github/workflow-templates/test-dapp.yml deleted file mode 100644 index 4dcb655ccea..00000000000 --- a/.github/workflow-templates/test-dapp.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Test Dapp - -on: - pull_request: - -jobs: - test-dapp: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: ['18.x'] - - steps: - - uses: actions/checkout@v4 - with: - submodules: 'true' - path: ./agoric-sdk - - uses: ./agoric-sdk/.github/actions/restore-node - with: - node-version: ${{ matrix.node-version }} - path: ./agoric-sdk - - - name: yarn link - run: | - yarn link-cli ~/bin/agoric - echo "/home/runner/bin" >> $GITHUB_PATH - working-directory: ./agoric-sdk - - # Select a branch on dapp to test against by adding text to the body of the - # pull request. For example: #dapp-encouragement-branch: zoe-release-0.7.0 - # The default is 'main' - - name: Get the appropriate dapp branch - id: get-branch - uses: actions/github-script@v7 - with: - result-encoding: string - script: | - let branch = 'main'; - if (context.payload.pull_request) { - const { body } = context.payload.pull_request; - const regex = /^\#[[INSERT_DAPP_NAME]]-branch:\s+(\S+)/m; - const result = regex.exec(body); - if (result) { - branch = result[1]; - } - } - console.log(branch); - return branch; - - - name: Check out dapp - uses: actions/checkout@v4 - with: - repository: Agoric/[[INSERT_DAPP_NAME]] - path: dapp - ref: ${{steps.get-branch.outputs.result}} - - - name: Agoric install in dapp - run: agoric install - working-directory: ./dapp - - - name: yarn build in dapp - run: yarn build - working-directory: ./dapp - - - name: yarn test in dapp - run: yarn test - working-directory: ./dapp diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 00000000000..5d5d26b95bd --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1,8 @@ +# Github Workflows + +We use these for CI. Some other workflows that we aren't currently using are: + +* [dapp template](https://github.com/Agoric/agoric-sdk/blob/7a08c6af641c62d8b0ef4a0c35090b6216a5be34/.github/workflow-templates/test-dapp.yml#L1) +* [ag-solo on xs](https://github.com/Agoric/agoric-sdk/blob/7a08c6af641c62d8b0ef4a0c35090b6216a5be34/.github/workflows/ag-solo-xs.yml.DISABLED#L1) +* [Test Dapp Treasury](https://github.com/Agoric/agoric-sdk/blob/7a08c6af641c62d8b0ef4a0c35090b6216a5be34/.github/workflows/test-dapp-treasury.yml.DISABLED#L1) +* [Update Hackathon branch](https://github.com/Agoric/agoric-sdk/blob/7a08c6af641c62d8b0ef4a0c35090b6216a5be34/.github/workflows/update-hackathon-branch.yml.DISABLED#L1) diff --git a/.github/workflows/ag-solo-xs.yml.DISABLED b/.github/workflows/ag-solo-xs.yml.DISABLED deleted file mode 100644 index 921c0cd1675..00000000000 --- a/.github/workflows/ag-solo-xs.yml.DISABLED +++ /dev/null @@ -1,76 +0,0 @@ -name: ag-solo on xs - -# xs builds are a bit more expensive, so only run them on PRs that target -# default - -on: - push: - branches: - # $default-branch - - master - - 'release-*' - - 'dev-*' - -jobs: - xs-build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '18.x' - - name: cache node modules - uses: actions/cache@v4 - with: - path: ~/.cache/yarn - key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: yarn install --frozen-lockfile - run: yarn install --frozen-lockfile - - name: yarn build - run: yarn build - - name: install moddable linux CLI SDK ag08 - run: | - cd $HOME - curl -L https://github.com/dckc/moddable/releases/download/ag08/moddable-linux-sdk.tgz | tar xzf - - - name: install tape-xs ag03 - # ISSUE: merge into agoric-sdk? - run: | - cd $HOME - curl -L https://github.com/agoric-labs/tape-xs/archive/ag03.tar.gz | tar xzf - - mv tape-xs-ag03 tape-xs - cd tape-xs - yarn install - - name: create /usr/local/bin/noflake - run: | - nf=/usr/local/bin/noflake - sudo tee "$nf" <<\EOF >/dev/null - #! /bin/sh - # noflake: rerun a command until it doesn't flake out - CMD=${1+"$@"} - FLAKE_STATUS=2 - RETRIES=3 - status=$FLAKE_STATUS - tries=0 - while test $tries -le $RETRIES -a $status -eq $FLAKE_STATUS; do - tries=`expr $tries + 1` - echo 1>&2 "noflake: try number $tries of: $CMD" - $CMD - status=$? - echo 1>&2 "noflake: exit status $status" - done - exit $status - EOF - sudo chmod +x "$nf" - - name: test eventual-send on xs - run: | - export MODDABLE=$HOME/moddable - export PATH=$MODDABLE/build/bin/lin/release:$PATH - export TAPE=$HOME/tape-xs - cd packages/eventual-send - node -r esm $TAPE/bin/tape-xs-build.js $PWD test/test*.js - noflake mcconfig -m -p x-cli-lin test-xs-manifest.json - $MODDABLE/build/bin/lin/release/eventual-send diff --git a/.github/workflows/test-dapp-treasury.yml.DISABLED b/.github/workflows/test-dapp-treasury.yml.DISABLED deleted file mode 100644 index f27e09dfc83..00000000000 --- a/.github/workflows/test-dapp-treasury.yml.DISABLED +++ /dev/null @@ -1,82 +0,0 @@ -name: Test Dapp Treasury - -on: - pull_request: - merge_group: - schedule: - - cron: '17 6 * * *' -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - test-dapp: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: ['18.x'] - - steps: - - uses: actions/checkout@v4 - with: - submodules: 'true' - path: ./agoric-sdk - - uses: ./agoric-sdk/.github/actions/restore-node - with: - node-version: ${{ matrix.node-version }} - path: ./agoric-sdk - - - name: yarn link - run: | - yarn link-cli ~/bin/agoric - echo "/home/runner/bin" >> $GITHUB_PATH - working-directory: ./agoric-sdk - - # Select a branch on dapp to test against by adding text to the body of the - # pull request. For example: #dapp-encouragement-branch: zoe-release-0.7.0 - # The default is 'main' - - name: Get the appropriate dapp branch - id: get-branch - uses: actions/github-script@v7 - with: - result-encoding: string - script: | - let branch = 'main'; - if (context.payload.pull_request) { - const { body } = context.payload.pull_request; - const regex = /^\#dapp-treasury-branch:\s+(\S+)/m; - const result = regex.exec(body); - if (result) { - branch = result[1]; - } - } - console.log(branch); - return branch; - - - name: Check out dapp - uses: actions/checkout@v4 - with: - repository: Agoric/dapp-treasury - path: dapp - ref: ${{steps.get-branch.outputs.result}} - - - name: Agoric install in dapp - run: agoric install - working-directory: ./dapp - - - name: yarn build in dapp - run: yarn build - working-directory: ./dapp - - - name: yarn test in dapp - run: yarn test - working-directory: ./dapp - - - name: notify on failure - if: failure() && github.event_name != 'pull_request' - uses: ./agoric-sdk/.github/actions/notify-status - with: - webhook: ${{ secrets.SLACK_WEBHOOK_URL }} - from: ${{ secrets.NOTIFY_EMAIL_FROM }} - to: ${{ secrets.NOTIFY_EMAIL_TO }} - password: ${{ secrets.NOTIFY_EMAIL_PASSWORD }} diff --git a/.github/workflows/test-documentation.yml b/.github/workflows/test-documentation.yml index a3ba41c7146..bade8a4cd19 100644 --- a/.github/workflows/test-documentation.yml +++ b/.github/workflows/test-documentation.yml @@ -26,12 +26,6 @@ jobs: node-version: ${{ matrix.node-version }} path: ./agoric-sdk - - name: yarn link - run: | - yarn link-cli ~/bin/agoric - echo "/home/runner/bin" >> $GITHUB_PATH - working-directory: ./agoric-sdk - # Select a branch on dapp to test against by adding text to the body of the # pull request. For example: #dapp-encouragement-branch: zoe-release-0.7.0 # The default is 'main' @@ -60,8 +54,10 @@ jobs: path: dapp ref: ${{steps.get-branch.outputs.result}} - - name: Agoric install in dapp - run: agoric install + - name: point dapp to agoric-SDK HEAD + # This assumes the dapp uses Yarn 4 and its other deps are compatible + # with the versions in the agoric-sdk packages. + run: yarn link ../agoric-sdk --all --relative working-directory: ./dapp - name: yarn build in dapp diff --git a/.github/workflows/update-hackathon-branch.yml.DISABLED b/.github/workflows/update-hackathon-branch.yml.DISABLED deleted file mode 100644 index 7b31a5d5f56..00000000000 --- a/.github/workflows/update-hackathon-branch.yml.DISABLED +++ /dev/null @@ -1,21 +0,0 @@ -# when 'master' changes, update the 'hackathon' branch to match - -name: update-hackathon-branch - -# *only* run upon changes to 'master': ignore PRs and other branches -on: - push: - branches: [ master ] - -jobs: - update-hackathon: - runs-on: ubuntu-latest - steps: - - uses: actions/github-script@v7 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - let repo = { owner: 'Agoric', repo: 'agoric-sdk' }; - let f = await github.git.getRef({ref: 'heads/master', ...repo}); - let sha = f.data.object.sha; - await github.git.updateRef({ref: 'heads/hackathon-2020-11', sha, ...repo});