diff --git a/.github/actions/build_contract_artifacts/action.yml b/.github/actions/build_contract_artifacts/action.yml index 3cd1db56e..86d6c43dd 100644 --- a/.github/actions/build_contract_artifacts/action.yml +++ b/.github/actions/build_contract_artifacts/action.yml @@ -31,9 +31,7 @@ runs: # start container docker run -d -v $(pwd):/repo --name build-container "${image}":"${image_version}" tail -f /dev/null # generate go bindings - docker exec build-container bash -c "\ - chown -R $(id -u):$(id -g) /repo &&\ - /repo/scripts/build-contract-artifacts-action.sh" + docker exec build-container bash -c "/repo/scripts/build-contract-artifacts-action.sh" # check go bindings git diff --stat --exit-code # build with keys @@ -47,10 +45,6 @@ runs: # clean up the container docker stop build-container docker rm build-container - # fix upload permissions - # chown -R $(whoami):$(whoami) ./contracts/target/deploy/ - # chmod -R 644 ./contracts/target/deploy/ - # should be used again after moving from projectserum/build to backpackapp/build - name: Install latest Git version (>= 2.18.0) for actions/checkout diff --git a/.github/workflows/contract-release.yml b/.github/workflows/contract-release.yml index eeaef9b96..685315943 100644 --- a/.github/workflows/contract-release.yml +++ b/.github/workflows/contract-release.yml @@ -33,7 +33,10 @@ jobs: - name: Build Artifacts env: psversion: ${{ needs.get_projectserum_version.outputs.projectserum_version }} - run: docker run -v $(pwd):/repo projectserum/build:"${psversion}"" bash -c "anchor build" + run: | + docker run -v $(pwd):/repo projectserum/build:"${psversion}" bash -c "\ + anchor build &&\ + chown -R $(id -u):$(id -g) /repo" - name: Generate archive run: | tar cfvz artifacts.tar.gz target/deploy/*.so target/idl/* diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6db6a927b..f7506c7d8 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -27,10 +27,10 @@ jobs: runs-on: ubuntu-latest needs: [get_projectserum_version] container: - image: projectserum/build:${{ needs.get_projectserum_version.outputs.projectserum_version }} - env: - RUSTUP_HOME: "/root/.rustup" - FORCE_COLOR: 1 + # image: projectserum/build:${{ needs.get_projectserum_version.outputs.projectserum_version }} + # env: + # RUSTUP_HOME: "/root/.rustup" + # FORCE_COLOR: 1 steps: - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 @@ -52,28 +52,65 @@ jobs: path: contracts/target key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - - run: solana-keygen new -o id.json --no-bip39-passphrase + - run: | + docker run -d -v $(pwd)/../:/repo --name build-container projectserum/build:"${psversion}" tail -f /dev/null + docker exec build-container bash -c "\ + RUSTUP_HOME="/root/.rustup" &&\ + FORCE_COLOR=1 &&\ + solana-keygen new -o id.json --no-bip39-passphrase" - name: Compile typescript client run: | - cd ../ts - yarn install --frozen-lockfile - yarn build - - run: yarn install --frozen-lockfile - - run: anchor test - - run: | - cd examples/hello-world - yarn install --frozen-lockfile - anchor test + docker exec build-container bash -c "\ + RUSTUP_HOME="/root/.rustup" &&\ + FORCE_COLOR=1 &&\ + cd /repo/ts &&\ + yarn install --frozen-lockfile &&\ + yarn build" + - name: anchor test contracts + run: | + docker exec build-container bash -c "\ + RUSTUP_HOME="/root/.rustup" &&\ + FORCE_COLOR=1 &&\ + cd /repo/contracts &&\ + yarn install --frozen-lockfile &&\ + anchor test" + - name: anchor test hello-world + run: | + docker exec build-container bash -c "\ + RUSTUP_HOME="/root/.rustup" &&\ + FORCE_COLOR=1 &&\ + cd /repo/examples/hello-world &&\ + yarn install --frozen-lockfile &&\ + anchor test" + # clean up the container + docker stop build-container + docker rm build-container + + # - run: solana-keygen new -o id.json --no-bip39-passphrase + # - name: Compile typescript client + # run: | + # cd ../ts + # yarn install --frozen-lockfile + # yarn build + # - name: anchor test contracts + # run: | + # yarn install --frozen-lockfile + # anchor test + # - name: anchor test hello-world + # run: | + # cd examples/hello-world + # yarn install --frozen-lockfile + # anchor test rust_lint: name: Rust Lint runs-on: ubuntu-latest needs: [get_projectserum_version] container: - image: projectserum/build:${{ needs.get_projectserum_version.outputs.projectserum_version }} - env: - RUSTUP_HOME: "/root/.rustup" - FORCE_COLOR: 1 + # image: projectserum/build:${{ needs.get_projectserum_version.outputs.projectserum_version }} + # env: + # RUSTUP_HOME: "/root/.rustup" + # FORCE_COLOR: 1 steps: - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 @@ -95,5 +132,12 @@ jobs: path: contracts/target key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - - run: cargo check - - run: cargo clippy -- -D warnings + - run: | + docker run -v $(pwd):/repo projectserum/build:"${psversion}" bash -c "\ + RUSTUP_HOME="/root/.rustup" &&\ + FORCE_COLOR=1 &&\ + cargo check &&\ + cargo clippy -- -D warnings" + + # - run: cargo check + # - run: cargo clippy -- -D warnings