Skip to content

Commit 48f745f

Browse files
committed
Github Actions on PR
1 parent 86e8381 commit 48f745f

1 file changed

Lines changed: 94 additions & 0 deletions

File tree

.github/workflows/pr.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Pull Request
2+
3+
concurrency:
4+
group: ${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
defaults:
8+
run:
9+
shell: bash
10+
11+
on:
12+
pull_request:
13+
branches:
14+
- '*'
15+
16+
env:
17+
PROJECT_NAME: ion
18+
profile: release
19+
20+
jobs:
21+
version:
22+
name: 🌐 Auto Version Increment
23+
runs-on: ubuntu-24.04
24+
outputs:
25+
VERSION: ${{ steps.generate.outputs.VERSION }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
- id: generate
29+
run: |
30+
set -e
31+
LAST_VERSION=$(curl -sSL https://api.github.com/repos/alshdavid/$PROJECT_NAME/releases/latest | jq -r ".tag_name" | cut -d "." -f 3)
32+
if [ "$LAST_VERSION" = "" ]; then
33+
LAST_VERSION="0"
34+
fi
35+
declare -i var="$LAST_VERSION"
36+
var=$var+1
37+
VERSION="0.0.$var"
38+
39+
echo $VERSION
40+
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
41+
42+
test:
43+
name: 🧪 Test
44+
runs-on: ubuntu-24.04
45+
steps:
46+
- uses: actions/checkout@v4
47+
- run: eval $(curl -sSf sh.davidalsh.com/rust.sh | sh)
48+
- run: cargo test
49+
50+
test-e2e:
51+
name: 🧪 Test E2E
52+
runs-on: ubuntu-24.04
53+
steps:
54+
- uses: actions/checkout@v4
55+
- run: eval $(curl -sSf sh.davidalsh.com/rust.sh | sh)
56+
- run: eval $(curl -sSf sh.davidalsh.com/deno.sh | sh)
57+
- run: cargo build
58+
- run: deno cache ./examples/**/*.test.ts
59+
- run: ./examples/run-tests-debug
60+
61+
format:
62+
name: 📝 Format
63+
runs-on: ubuntu-24.04
64+
steps:
65+
- uses: actions/checkout@v4
66+
- run: eval $(curl -sSf sh.davidalsh.com/rust.sh | sh)
67+
- run: cargo install cargo-xfmt
68+
- run: cargo --version
69+
- run: cargo clippy --version
70+
- run: cargo xfmt --check
71+
- run: cargo clippy -- --deny "warnings"
72+
73+
build_linux_amd64:
74+
name: 🐥 Linux AMD64
75+
runs-on: ubuntu-24.04
76+
defaults:
77+
run:
78+
working-directory: ${{ github.workspace }}
79+
container:
80+
image: debian:12
81+
env:
82+
DEBIAN_FRONTEND: noninteractive
83+
steps:
84+
- uses: actions/checkout@v4
85+
- run: apt-get update -y && apt-get install -y curl build-essential
86+
- run: eval $(curl -sSf sh.davidalsh.com/just.sh | sh)
87+
- run: eval $(curl -sSf sh.davidalsh.com/rust.sh | sh)
88+
- run: just build
89+
- uses: actions/upload-artifact@v4
90+
with:
91+
name: ion-linux-amd64
92+
path: ${{ github.workspace }}/target/linux-amd64/release/**/*
93+
if-no-files-found: error
94+
retention-days: 1

0 commit comments

Comments
 (0)