diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml new file mode 100644 index 0000000..8584492 --- /dev/null +++ b/.github/workflows/unit-test.yml @@ -0,0 +1,36 @@ +name: Unit Tests + +on: + pull_request: + branches: [main] + push: + branches: [main] + + +jobs: + tests: + name: Flow CLI Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: "true" + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.18 + - name: Set up Node + uses: actions/setup-node@v2 + with: + node-version: ^18 + - name: Install Flow dependencies + run: npm i + - name: Install Flow CLI + run: bash -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)" -- v1.17.0 + - name: Run tests + run: sh ./run-tests.sh + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: Flowtyio/flowty-drops \ No newline at end of file diff --git a/contracts/DropFactory.cdc b/contracts/DropFactory.cdc index 090a189..a344f91 100644 --- a/contracts/DropFactory.cdc +++ b/contracts/DropFactory.cdc @@ -17,7 +17,7 @@ pub contract DropFactory { minterCap: Capability<&{FlowtyDrops.Minter}> ): @FlowtyDrops.Drop { pre { - Type<@FungibleToken.Vault>().isSubtype(of: paymentTokenType): "paymentTokenType must be a FungibleToken" + paymentTokenType.isSubtype(of: Type<@FungibleToken.Vault>()): "paymentTokenType must be a FungibleToken" } // This drop is always on and never ends. diff --git a/tests/test_helpers.cdc b/tests/test_helpers.cdc index cdeb025..6d69116 100644 --- a/tests/test_helpers.cdc +++ b/tests/test_helpers.cdc @@ -157,6 +157,7 @@ pub fun deployAll() { deploy("FlowtySwitches", "../contracts/FlowtySwitches.cdc", []) deploy("FlowtyPricers", "../contracts/FlowtyPricers.cdc", []) deploy("FlowtyAddressVerifiers", "../contracts/FlowtyAddressVerifiers.cdc", []) + deploy("DropFactory", "../contracts/DropFactory.cdc", []) deploy("OpenEditionNFT", "../contracts/nft/OpenEditionNFT.cdc", []) }