Merge pull request #533 from dojoengine/fix/npm-provenance-repository #1658
This file contains hidden or 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
| name: ci | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| DOJO_VERSION: v1.7.2 | |
| jobs: | |
| format-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - name: Cache Bun modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.bun/install/cache | |
| node_modules | |
| key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Run Prettier | |
| run: bun run format:check --ui stream | |
| cairo-build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| world: [dojo-starter, onchain-dash] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - uses: ./.github/actions/setup-dojo | |
| with: | |
| dojo-version: v1.7.2 | |
| scarb-version: 2.12.2 | |
| - name: Cache Cairo build artifacts | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| worlds/${{ matrix.world }}/target | |
| key: ${{ runner.os }}-cairo-${{ matrix.world }}-${{ hashFiles(format('worlds/{0}/**/*.cairo', matrix.world)) }} | |
| restore-keys: | | |
| ${{ runner.os }}-cairo-${{ matrix.world }}- | |
| - name: Build and test ${{ matrix.world }} | |
| run: | | |
| cd worlds/${{ matrix.world }} | |
| scarb build | |
| scarb test | |
| build-packages: | |
| runs-on: ubuntu-latest | |
| needs: [format-check] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - uses: arduino/setup-protoc@v3 | |
| - name: Cache turbo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .turbo | |
| **/.turbo | |
| key: ${{ runner.os }}-turbo-${{ hashFiles('**/turbo.json') }}-${{ hashFiles('**/package.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo- | |
| - name: Cache Bun modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.bun/install/cache | |
| node_modules | |
| key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Cache build outputs | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| packages/*/dist | |
| key: ${{ runner.os }}-build-packages-${{ hashFiles('packages/**/src/**') }}-${{ hashFiles('packages/**/package.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-build-packages- | |
| - name: Setup npm | |
| run: | | |
| npm set @ponderingdemocritus:registry=https://npm.pkg.github.com/dojoengine | |
| npm set "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Build packages | |
| run: bun run build:packages --ui stream | |
| - name: Run tests | |
| run: bun test | |
| build-examples: | |
| runs-on: ubuntu-latest | |
| needs: [format-check] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - name: Install Protoc | |
| uses: arduino/setup-protoc@v3 | |
| - name: Cache turbo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .turbo | |
| **/.turbo | |
| key: ${{ runner.os }}-turbo-${{ hashFiles('**/turbo.json') }}-${{ hashFiles('**/package.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo- | |
| - name: Cache Bun modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.bun/install/cache | |
| node_modules | |
| key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Cache build outputs | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| example/dist | |
| key: ${{ runner.os }}-build-examples-${{ hashFiles('example/**/src/**') }}-${{ hashFiles('example/package.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-build-examples- | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Build examples | |
| run: bun run build:examples --ui stream |