Merge pull request #13 from lobis/pre-commit-ci-update-config #89
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
name: build | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
EXECUTABLE_NAME: fractal-explorer-app | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check formatting | |
run: cargo fmt -- --check | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --verbose | |
windows-executable: | |
name: Windows executable | |
needs: build | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Executable | |
run: | | |
cargo build --release | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: windows-executable | |
path: | | |
target/release/${{ env.EXECUTABLE_NAME }}.exe | |
macos-executable: | |
name: macOS executable | |
needs: build | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Executable | |
run: | | |
cargo build --release | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: macos-executable | |
path: | | |
target/release/${{ env.EXECUTABLE_NAME }} | |
web-assembly: | |
name: WebAssembly build | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install wasm-pack | |
run: cargo install wasm-pack | |
- name: WASM build | |
run: wasm-pack build --target web --out-dir public/pkg | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: web-assembly-build | |
path: public/ | |
- name: Setup Pages | |
uses: actions/configure-pages@v1 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: public/ | |
deploy: # https://github.com/actions/deploy-pages | |
name: GitHub Pages deployment | |
needs: web-assembly | |
runs-on: ubuntu-latest | |
if: ${{ github.ref == 'refs/heads/main' }} | |
# 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 | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |