Skip to content

Commit 40b6be9

Browse files
committed
split workflows
1 parent ced9adc commit 40b6be9

File tree

3 files changed

+95
-57
lines changed

3 files changed

+95
-57
lines changed

.github/workflows/check.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Check
2+
3+
on:
4+
push:
5+
branches: [ "*" ]
6+
pull_request:
7+
branches: [ "*" ]
8+
9+
jobs:
10+
check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '20'
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v4
22+
with:
23+
go-version: '1.23'
24+
25+
- name: Install embedme
26+
run: npm install -g embedme
27+
28+
- name: Verify README.md embedded code
29+
run: npx embedme --verify README.md
30+
31+
- name: Check formatting
32+
run: |
33+
if [ -n "$(go fmt ./...)" ]; then
34+
echo "Some files are not properly formatted. Please run 'go fmt ./...'"
35+
exit 1
36+
fi

.github/workflows/go.yml

Lines changed: 7 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -10,57 +10,17 @@ on:
1010
branches: [ "main" ]
1111

1212
jobs:
13-
check:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v4
17-
18-
- name: Set up Node.js
19-
uses: actions/setup-node@v4
20-
with:
21-
node-version: '20'
22-
23-
- name: Install embedme
24-
run: npm install -g embedme
25-
26-
- name: Verify README.md embedded code
27-
run: npx embedme --verify README.md
28-
29-
- name: Set up Go
30-
uses: actions/setup-go@v4
31-
with:
32-
go-version: '1.23'
33-
34-
- name: Check formatting
35-
run: |
36-
if [ -n "$(go fmt ./...)" ]; then
37-
echo "Some files are not properly formatted. Please run 'go fmt ./...'"
38-
exit 1
39-
fi
40-
4113
build:
4214
continue-on-error: true
4315
strategy:
4416
fail-fast: false
4517
matrix:
46-
sys:
47-
- {os: macos-latest, shell: bash}
48-
- {os: ubuntu-24.04, shell: bash}
49-
- {os: windows-latest, shell: bash}
50-
defaults:
51-
run:
52-
shell: ${{ matrix.sys.shell }}
53-
runs-on: ${{matrix.sys.os}}
18+
os:
19+
- macos-latest
20+
- ubuntu-24.04
21+
- windows-latest
22+
runs-on: ${{matrix.os}}
5423
steps:
55-
# - uses: msys2/setup-msys2@v2
56-
# if: matrix.sys.os == 'windows-latest'
57-
# with:
58-
# update: true
59-
# install: >-
60-
# curl
61-
# git
62-
# pkg-config
63-
6424
- uses: actions/checkout@v4
6525

6626
- name: Set up Go
@@ -74,13 +34,13 @@ jobs:
7434
update-environment: true
7535

7636
- name: Generate Python pkg-config for windows (patch)
77-
if: matrix.sys.os == 'windows-latest'
37+
if: matrix.os == 'windows-latest'
7838
run: |
7939
mkdir -p $PKG_CONFIG_PATH
8040
cp .github/assets/python3-embed.pc $PKG_CONFIG_PATH/
8141
8242
- name: Install tiny-pkg-config for windows (patch)
83-
if: matrix.sys.os == 'windows-latest'
43+
if: matrix.os == 'windows-latest'
8444
run: |
8545
set -x
8646
curl -L https://github.com/cpunion/tiny-pkg-config/releases/download/v0.2.0/tiny-pkg-config_Windows_x86_64.zip -o /tmp/tiny-pkg-config.zip
@@ -96,16 +56,6 @@ jobs:
9656

9757
- name: Test with coverage
9858
run: go test -coverprofile=coverage.txt -covermode=atomic ./...
99-
100-
- name: Test gopy
101-
run: |
102-
set -x
103-
gopy init $HOME/foo
104-
cd $HOME/foo
105-
gopy build -v .
106-
export GP_INJECT_DEBUG=1
107-
gopy run -v .
108-
gopy install -v .
10959

11060
- name: Upload coverage to Codecov
11161
uses: codecov/codecov-action@v4

.github/workflows/gopy.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow will build a golang project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3+
4+
name: Gopy
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
test:
14+
continue-on-error: true
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os:
19+
- macos-latest
20+
- ubuntu-24.04
21+
- windows-latest
22+
runs-on: ${{matrix.os}}
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Set up Go
27+
uses: actions/setup-go@v4
28+
with:
29+
go-version: 1.23
30+
31+
- name: Install gopy
32+
run: go install ./cmd/gopy
33+
34+
- name: Test init project
35+
run: gopy init $HOME/foo
36+
37+
- name: Test build project
38+
run: |
39+
cd $HOME/foo
40+
gopy build -o foo.out .
41+
./foo.out
42+
43+
- name: Test run project
44+
run: |
45+
export GP_INJECT_DEBUG=1
46+
cd $HOME/foo
47+
gopy run -v .
48+
49+
- name: Test install project
50+
run: |
51+
cd $HOME/foo
52+
gopy install -v .

0 commit comments

Comments
 (0)