From c13b8af711f9edfc812d754f2af128022c5eb8de Mon Sep 17 00:00:00 2001 From: bal7hazar Date: Tue, 15 Oct 2024 17:20:27 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20Add=20github=20actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/setup/action.yaml | 15 ++++++++++ .github/workflows/contracts.yaml | 48 +++++++++++++++++++++++++++++++ .github/workflows/packages.yaml | 48 +++++++++++++++++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 .github/actions/setup/action.yaml create mode 100644 .github/workflows/contracts.yaml create mode 100644 .github/workflows/packages.yaml diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml new file mode 100644 index 0000000..87835e1 --- /dev/null +++ b/.github/actions/setup/action.yaml @@ -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 diff --git a/.github/workflows/contracts.yaml b/.github/workflows/contracts.yaml new file mode 100644 index 0000000..7dffb14 --- /dev/null +++ b/.github/workflows/contracts.yaml @@ -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 diff --git a/.github/workflows/packages.yaml b/.github/workflows/packages.yaml new file mode 100644 index 0000000..5aa971f --- /dev/null +++ b/.github/workflows/packages.yaml @@ -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