build: derive version from git tag #41
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build: | |
runs-on: ${{ matrix.OS }} | |
strategy: | |
matrix: | |
OS: [ "macos-12", "windows-2022" ] | |
include: | |
- suffix: "mac" | |
OS: "macos-12" | |
- suffix: "win" | |
OS: "windows-2022" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: coursier/cache-action@v6 | |
- uses: VirtusLab/scala-cli-setup@v1.0.5 | |
- name: Unit tests | |
run: scala-cli --power test . | |
- name: Package app | |
run: scala-cli --power .github/scripts/package.sc | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: cratetom3u-${{ matrix.suffix }} | |
path: target/executable | |
if-no-files-found: error | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: reports-${{ matrix.suffix }} | |
path: target/temp | |
if-no-files-found: error | |
format: | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: coursier/cache-action@v6 | |
- uses: VirtusLab/scala-cli-setup@v1.0.5 | |
- name: Scalafmt check | |
run: | | |
scala-cli fmt --check . || ( | |
echo "To format code run" | |
echo " scala-cli fmt ." | |
exit 1 | |
) |