Skip to content

Commit

Permalink
fix(ci): fine tune steps
Browse files Browse the repository at this point in the history
  • Loading branch information
duncdrum committed Mar 23, 2024
1 parent 93378eb commit 28063d9
Showing 1 changed file with 34 additions and 23 deletions.
57 changes: 34 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ name: compile and test
on: [push, pull_request]

jobs:
static:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
java-version: [11, 17]


steps:
# Checkout code
Expand All @@ -38,26 +40,35 @@ jobs:
xmllint --noout \
$(find . -type f -name '*.xml')
- name: Build Expath Package
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
- run: ant -Dapp.version=1.0.0-SNAPSHOT

- name: upload xar package
if: ${{ matrix.java-version == 17 }}
uses: actions/upload-artifact@v4
with:
name: frus-xar
path: build/*.xar
if-no-files-found: ignore

# Commit Toc files
- name: Commit and Push
if: ${{ matrix.java-version == 17}}
if: ${{ matrix.java-version == 17 }}
uses: actions-x/commit@v6
with:
message: "fix(toc): update [skip ci]"
build:
test:
runs-on: ubuntu-latest
needs: static
needs: build
strategy:
fail-fast: false
matrix:
# 7.0.0-SNAPSHOT and 6.2.1 created
exist-version: [latest, release]
java-version: [11, 17]
exclude:
- exist-version: release
java-version: 17
- exist-version: latest
java-version: 11

steps:
- name: Maximize build space
Expand All @@ -74,14 +85,22 @@ jobs:
run: sudo service docker restart

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v3

# Checkout code
- uses: actions/checkout@v4
- name: Install Test Dependencies
run: |
sudo apt-get update
sudo apt-get install -y bats
- name: create build/
run: mkdir build

# TODO avoid 2n checkout and re-use move expath to previous step
# mind java matrix for build?
- uses: actions/download-artifact@v4
with:
name: frus-xar
path: build

# sanity check
- name: check os
Expand All @@ -95,14 +114,6 @@ jobs:
- name: Check config
run: docker info

# Build
- name: Build Expath Package
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
- run: ant -Dapp.version=1.0.0-SNAPSHOT

# Install
- name: Start exist-ci containers
run: |
Expand Down Expand Up @@ -142,7 +153,7 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
needs: build
needs: test
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
Expand Down

0 comments on commit 28063d9

Please sign in to comment.