Skip to content

Commit

Permalink
Setup github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoplavkov committed Aug 15, 2024
1 parent 49afdb1 commit 7a94940
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/actions/initialize/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Initialize
description: Common steps for initialization

runs:
using: composite

steps:
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Setup Fuelup
shell: bash
run: |
curl https://install.fuel.network | sh
echo "$HOME/.fuelup/bin:${GITHUB_PATH}" >> $GITHUB_PATH
- name: Set default testnet toolchain
shell: bash
run: |
fuelup update
fuelup toolchain install testnet
fuelup default testnet
- name: Build the contracts
shell: bash
run: forc build

- name: Cargo build
shell: bash
run: cargo build
21 changes: 21 additions & 0 deletions .github/workflows/check_fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check formatting

on:
- push
- workflow_dispatch

jobs:
tests:
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v4

- uses: ./.github/actions/initialize

- name: Check sway formatting
run: forc fmt --check

- name: Check rust formatting
run: cargo fmt --check
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Run tests

on:
- push
- workflow_dispatch

jobs:
tests:
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v4

- uses: ./.github/actions/initialize

- name: Run sway tests
run: forc test

- name: Run rust tests
run: cargo test

0 comments on commit 7a94940

Please sign in to comment.