diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..5fc6e05 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,46 @@ +# 版权 @2024 凹语言 作者。保留所有权利。 + +name: Run Wa App +on: + pull_request: + push: + branches: + - main + - master + - "releases/*" +jobs: + build-and-test-ubuntu: + runs-on: ubuntu-latest + steps: + - name: Git checkout + uses: actions/checkout@v2 + + - name: Set up Wa(凹语言) + uses: wa-lang/setup-wa + + - run: wa -v + - run: wa run heart.wa + + build-and-test-windows: + runs-on: windows-latest + steps: + - name: Git checkout + uses: actions/checkout@v2 + + - name: Set up Wa(凹语言) + uses: wa-lang/setup-wa + + - run: wa -v + - run: wa run heart.wa + + build-and-test-macos: + runs-on: macos-latest + steps: + - name: Git checkout + uses: actions/checkout@v2 + + - name: Set up Wa(凹语言) + uses: wa-lang/setup-wa + + - run: wa -v + - run: wa run heart.wa diff --git a/README.md b/README.md index 55a0dcd..f769a8b 100644 --- a/README.md +++ b/README.md @@ -1 +1,42 @@ -# Setup Wa Language Action +# Setup Wa Language + +```yaml +name: Test +on: push +jobs: + build: + name: Run Wa App + runs-on: ubuntu-latest + steps: + - name: Git checkout + uses: actions/checkout@v2 + + - name: Set up Wa(凹语言) + uses: wa-lang/setup-wa + + - run: wa -v + - run: wa run heart.wa +``` + +Output: + +```text +$ wa run heart.wa + + + @@@@@@ @@@@@@ + @@@@@@@@@@@@@ @@@@@@@@@@@@@@ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@ + @@@@@@@@@@@@@@@@@@@@@@@@@@ + @@@@@@@@@@@@@@@@@@@@@@@ + @@@@@@@@@@@@@@@@@@@@ + @@@@@@@@@@@@@@ + @@@@@@@@ + @@ +``` diff --git a/heart.wa b/heart.wa new file mode 100644 index 0000000..6056e6d --- /dev/null +++ b/heart.wa @@ -0,0 +1,16 @@ +// 版权 @2019 凹语言 作者。保留所有权利。 + +func main { + a := 0.0 + for y := 1.5; y > -1.5; y = y - 0.15 { + for x := -1.5; x < 1.5; x = x + 0.07 { + a = x*x + y*y - 1.0 + if a*a*a < x*x*y*y*y { + print("@") + } else { + print(" ") + } + } + println() + } +}