Skip to content

added more tests

added more tests #121

Workflow file for this run

name: Release
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
on:
push:
branches:
- "main"
env:
PROJECT_NAME: ion
profile: release
jobs:
version:
name: 🌐 Auto Version Increment
runs-on: ubuntu-24.04
outputs:
VERSION: ${{ steps.generate.outputs.VERSION }}
steps:
- uses: actions/checkout@v4
- id: generate
run: |
set -e
LAST_VERSION=$(curl -sSL https://api.github.com/repos/alshdavid/$PROJECT_NAME/releases/latest | jq -r ".tag_name" | cut -d "." -f 3)
if [ "$LAST_VERSION" = "" ]; then
LAST_VERSION="0"
fi
declare -i var="$LAST_VERSION"
var=$var+1
VERSION="0.0.$var"
echo $VERSION
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
test:
name: πŸ§ͺ Test
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: eval $(curl -sSf sh.davidalsh.com/rust.sh | sh)
- run: cargo test
test-e2e:
name: πŸ§ͺ Test E2E
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: eval $(curl -sSf sh.davidalsh.com/rust.sh | sh)
- run: eval $(curl -sSf sh.davidalsh.com/deno.sh | sh)
- run: ./examples/run-tests-debug
format:
name: πŸ“ Format
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: eval $(curl -sSf sh.davidalsh.com/rust.sh | sh)
- run: cargo install cargo-xfmt
- run: cargo xfmt --check
- run: cargo clippy -- --deny "warnings"
build_linux_amd64:
name: πŸ₯ Linux AMD64
runs-on: ubuntu-24.04
defaults:
run:
working-directory: ${{ github.workspace }}
container:
image: debian:12
env:
DEBIAN_FRONTEND: noninteractive
steps:
- uses: actions/checkout@v4
- run: apt-get update -y && apt-get install -y curl build-essential
- run: eval $(curl -sSf sh.davidalsh.com/just.sh | sh)
- run: eval $(curl -sSf sh.davidalsh.com/rust.sh | sh)
- run: just build
- uses: actions/upload-artifact@v4
with:
name: ion-linux-amd64
path: ${{ github.workspace }}/target/linux-amd64/release/**/*
if-no-files-found: error
retention-days: 1
build_linux_arm64:
name: πŸ₯ Linux ARM64
runs-on: ubuntu-24.04-arm
defaults:
run:
working-directory: ${{ github.workspace }}
container:
image: debian:12
env:
DEBIAN_FRONTEND: noninteractive
steps:
- uses: actions/checkout@v4
- run: apt-get update -y && apt-get install -y curl build-essential
- run: eval $(curl -sSf sh.davidalsh.com/just.sh | sh)
- run: eval $(curl -sSf sh.davidalsh.com/rust.sh | sh)
- run: just build
- uses: actions/upload-artifact@v4
with:
name: ion-linux-arm64
path: ${{ github.workspace }}/target/linux-arm64/release/**/*
if-no-files-found: error
retention-days: 1
build_macos_arm64:
name: 🍎 MacOS ARM64
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- run: eval $(curl -sSf sh.davidalsh.com/just.sh | sh)
- run: eval $(curl -sSf sh.davidalsh.com/rust.sh | sh)
- run: just build
- uses: actions/upload-artifact@v4
with:
name: ion-macos-arm64
path: ${{ github.workspace }}/target/macos-arm64/release/**/*
if-no-files-found: error
retention-days: 1
build_windows_amd64:
name: 🟦 Windows amd64
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- run: eval $(curl -sSf sh.davidalsh.com/just.sh | sh)
- run: eval $(curl -sSf sh.davidalsh.com/rust.sh | sh)
- run: just build
- uses: actions/upload-artifact@v4
with:
name: ion-windows-amd64
path: ${{ github.workspace }}/target/windows-amd64/release/**/*
if-no-files-found: error
retention-days: 1
publish-github-release:
name: "πŸ”„ Publish Github Release"
runs-on: ubuntu-24.04
needs:
- version
- test
- test-e2e
- format
- build_linux_amd64
- build_linux_arm64
- build_macos_arm64
- build_windows_amd64
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with: { path: artifacts }
- name: Publish` Github Release
env:
VERSION: ${{needs.version.outputs.VERSION}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
echo "Tag: ${VERSION}"
gh release create $VERSION --draft --notes "Automatically built binaries"
gh release edit $VERSION --title "πŸš€ Latest"
cd artifacts
for name in *; do
echo $name
cd "${{ github.workspace }}/artifacts/${name}"
ls -l
chmod +x ./*
tar -czvf ./${name}.tar.gz ./*
gh release upload $VERSION ${name}.tar.gz
done
gh release edit $VERSION --draft=false