Merge pull request #48 from kcl-lang/feat-add-load-package-with-cache… #100
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: | |
pull_request: | |
push: | |
branches: | |
- main | |
- "releases/*" | |
permissions: | |
contents: read | |
jobs: | |
rust-test: | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v2 | |
- name: Install rust nightly toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: 1.73 | |
override: true | |
components: clippy, rustfmt | |
- name: Rust code test | |
run: cargo test | |
go-test: | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.21 | |
- name: Go code test | |
run: go test ./... | |
python-test: | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v2 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install dependencies | |
working-directory: python | |
run: | | |
python3 -m pip install -r ./scripts/requirements.txt | |
python3 -m pip install pytest | |
python3 -m pip install setuptools wheel twine | |
- name: Python code test | |
working-directory: python | |
run: python3 -m pytest | |
java-test: | |
permissions: | |
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows | |
contents: read # for actions/checkout to fetch code | |
name: "${{ matrix.root-pom }} on JDK ${{ matrix.java }} for the classifier ${{ matrix.classifier }}" | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
classifier: linux-x86_64 | |
java: 8 | |
root-pom: 'pom.xml' | |
- os: ubuntu-latest | |
classifier: linux-aarch_64 | |
java: 8 | |
root-pom: 'pom.xml' | |
- os: windows-latest | |
classifier: windows-x86_64 | |
java: 8 | |
root-pom: 'pom.xml' | |
- os: macos-latest | |
classifier: osx-x86_64 | |
java: 8 | |
root-pom: 'pom.xml' | |
- os: macos-latest | |
classifier: osx-aarch_64 | |
java: 8 | |
root-pom: 'pom.xml' | |
runs-on: ${{ matrix.os }} | |
env: | |
ROOT_POM: ${{ matrix.root-pom }} | |
steps: | |
- name: 'Check out repository' | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | |
- name: 'Set up JDK ${{ matrix.java }}' | |
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: 'zulu' | |
cache: 'maven' | |
server-id: sonatype-nexus-snapshots | |
server-username: CI_DEPLOY_USERNAME | |
server-password: CI_DEPLOY_PASSWORD | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install rust nightly toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: 1.73 | |
override: true | |
components: clippy, rustfmt | |
- name: Setup linux-aarch_64 rust target | |
if: "contains(matrix.classifier, 'linux-aarch_64')" | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu | |
# Setup for cargo | |
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV | |
- name: 'Build and Deploy' | |
shell: bash | |
working-directory: java | |
run: make # && make deploy | |
env: | |
CI_DEPLOY_USERNAME: ${{ secrets.NEXUS_STAGE_DEPLOYER_USER }} | |
CI_DEPLOY_PASSWORD: ${{ secrets.NEXUS_STAGE_DEPLOYER_PW }} |