-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
test: | ||
name: Run test suite | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: jorelali/setup-elm@v6 | ||
with: | ||
elm-version: 0.19.1 | ||
|
||
- name: Run elm tests | ||
run: npx elm-test --report="junit" > test-results.xml | ||
|
||
- name: Test Summary | ||
uses: test-summary/action@v2 | ||
with: | ||
paths: "test-results.xml" | ||
if: always() | ||
build: | ||
name: Build and minimize Elm | ||
runs-on: ubuntu-22.04 | ||
needs: test | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: jorelali/setup-elm@v6 | ||
with: | ||
elm-version: 0.19.1 | ||
- name: Compile Elm to JS | ||
run: elm make src/Main.elm --optimize --output elm.js | ||
|
||
- name: Tree shake and minimize compiled js | ||
run: | | ||
npx uglify-js elm.js --compress 'pure_funcs=[F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9],pure_getters,unsafe_comps,unsafe' --mangle 'reserved=[F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9]' --output elm.min.js | ||
- name: Move to build directory | ||
run: | | ||
mkdir build | ||
mv elm.min.js build/elm.js | ||
mv index.html build/ | ||
mv style.css build/ | ||
- name: Upload production artifacts | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
name: github-pages | ||
path: build/ | ||
|
||
# Deploy job | ||
deploy: | ||
# Add a dependency to the build job | ||
needs: build | ||
|
||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | ||
permissions: | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source | ||
|
||
# Deploy to the github-pages environment | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
# Specify runner + deployment step | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Elm Black Jack | ||
|
||
An implementation of Black Jack in Elm | ||
|
||
## Testing | ||
|
||
This program uses [elm-program-test](https://github.com/avh4/elm-program-test) to test the application logic in addition to using just regular elm-test for unit tests. |