Skip to content

Commit

Permalink
chore: Update GitHub Actions workflow to fix path for frontend artifa…
Browse files Browse the repository at this point in the history
…ct upload
  • Loading branch information
mashharuki committed Jun 9, 2024
1 parent 65e70b5 commit eed18b1
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Deploy to GitHub Pages
name: Build and Test on GitHub Actions

on:
push:
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Install dependencies
run: yarn install

# テストコマンドを実行
- name: Test Smart Contract
run: yarn backend test

Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
- name: Install dependencies
run: yarn install

# ビルドコマンドを実行
- name: Build
run: yarn frontend build
env:
Expand All @@ -121,7 +121,7 @@ jobs:
name: github-pages
path: ./pkgs/frontend/out
retention-days: 5

# デプロイ自体はうまく行くもののアプリの挙動がおかしいので一旦はNetlifyにデプロイした方が良い。
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Haruki Kondo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
23 changes: 19 additions & 4 deletions pkgs/backend/test/HelloWorld.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@ import {expect} from "chai";
import {ethers} from "hardhat";

/**
* deploy HelloWorld contract method
* deploy HelloWorld & SampleForwarder contract method
* @returns
*/
async function deployHelloWorld() {
const [owner] = await ethers.getSigners();
const SampleForwarder = await ethers.getContractFactory("SampleForwarder");
const sampleForwarder = await SampleForwarder.deploy();
const HelloWorld = await ethers.getContractFactory("HelloWorld");
const helloWorld = await HelloWorld.deploy(owner.address);
return helloWorld;
const helloWorld = await HelloWorld.deploy(sampleForwarder.target);
return {
helloWorld,
sampleForwarder,
owner,
};
}

describe("HelloWorld contract", function () {
it("Deployment should assign the total supply of tokens to the owner", async function () {
const helloWorld = await deployHelloWorld();
const {helloWorld} = await deployHelloWorld();

const initialText = await helloWorld.text();
expect(initialText).to.equal("");
Expand All @@ -25,4 +31,13 @@ describe("HelloWorld contract", function () {
const updatedText = await helloWorld.text();
expect(updatedText).to.equal(newText);
});

it("Check SampleForwarder Address", async function () {
const {helloWorld, sampleForwarder} = await deployHelloWorld();

// get SampleForwarder address
const sampleForwarderAddress = await helloWorld.trustedForwarder();
// chek SampleForwarder address
expect(sampleForwarderAddress).to.equal(sampleForwarder.target);
});
});
2 changes: 2 additions & 0 deletions pkgs/frontend/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ export default function Home() {
</h3>
<h3>Your Balance</h3>
<h3>{intmaxContext.balance} ETH</h3>
{/*
<button onClick={sendTx} className={styles.authButton}>
Send Sample Tx
</button>
*/}
<br />
<button onClick={gasslessRequest} className={styles.authButton}>
Send GasslessRequest
Expand Down

0 comments on commit eed18b1

Please sign in to comment.