Skip to content

Commit

Permalink
💚 Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bal7hazar committed Oct 15, 2024
1 parent 0dbf78c commit c13b8af
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Setup"
description: "Setup tooling"
runs:
using: "composite"
steps:
- name: Install dojoup
run: curl -L https://install.dojoengine.org | bash
shell: bash

- name: Install dojo
run: |
/home/runner/.config/.dojo/bin/dojoup --version ${{ env.DOJO_VERSION }}
sudo mv /home/runner/.config/.dojo/bin/katana /usr/local/bin/
sudo mv /home/runner/.config/.dojo/bin/sozo /usr/local/bin/
shell: bash
48 changes: 48 additions & 0 deletions .github/workflows/contracts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on:
push:
pull_request:

env:
DOJO_VERSION: v1.0.0-alpha.14
SCARB_VERSION: 2.7.0
WORKING_DIRECTORY: ./contracts

jobs:
check:
runs-on: ubuntu-latest
name: Check format
steps:
- uses: actions/checkout@v4
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: ${{ env.SCARB_VERSION }}
- name: Format
working-directory: ${{ env.WORKING_DIRECTORY }}
run: scarb fmt --check
shell: bash

build:
needs: check
runs-on: ubuntu-latest
name: Build package
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Build
working-directory: ${{ env.WORKING_DIRECTORY }}
run: sozo build
shell: bash

test:
needs: [check, build]
runs-on: ubuntu-latest
name: Test package
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Test
working-directory: ${{ env.WORKING_DIRECTORY }}
run: sozo test
shell: bash
48 changes: 48 additions & 0 deletions .github/workflows/packages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on:
push:
pull_request:

env:
DOJO_VERSION: v1.0.0-alpha.14
SCARB_VERSION: 2.7.0
WORKING_DIRECTORY: ./packages

jobs:
check:
runs-on: ubuntu-latest
name: Check format
steps:
- uses: actions/checkout@v4
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: ${{ env.SCARB_VERSION }}
- name: Format
working-directory: ${{ env.WORKING_DIRECTORY }}
run: scarb fmt --check
shell: bash

build:
needs: check
runs-on: ubuntu-latest
name: Build package
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Build
working-directory: ${{ env.WORKING_DIRECTORY }}
run: sozo build
shell: bash

test:
needs: [check, build]
runs-on: ubuntu-latest
name: Test package
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Test
working-directory: ${{ env.WORKING_DIRECTORY }}
run: sozo test
shell: bash

0 comments on commit c13b8af

Please sign in to comment.