Skip to content

Commit

Permalink
ci(windows): Add back windows target (#512)
Browse files Browse the repository at this point in the history
Add back the Windows `x86_64` target and format Github YAML files.
  • Loading branch information
afnanenayet authored Dec 18, 2022
1 parent 189eb9e commit 2a32fcc
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 41 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:
workflow_dispatch:
inputs:
tag_name:
description: "Tag name for release"
description: 'Tag name for release'
required: true
default: nightly
push:
tags:
- "*"
- '*'

jobs:
create-github-release:
Expand All @@ -32,7 +32,7 @@ jobs:
env:
default_tag_name: nightly
run: |
echo "VERSION=${{ github.event.inputs.tag_name || env.default_tag_name }}" >> $GITHUB_ENV
echo "VERSION=${{ github.event.inputs.tag_name || env.default_tag_name }}" >> $GITHUB_ENV
- name: Validate version environment variable
run: |
echo "Version being built against is version ${{ env.VERSION }}"!
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
publish:
name: Publish for ${{ matrix.job.target }}
runs-on: ${{ matrix.job.os }}
needs: [ create-github-release ]
needs: [create-github-release]
strategy:
matrix:
job:
Expand All @@ -130,6 +130,10 @@ jobs:
artifact_name: diffsitter
target: x86_64-apple-darwin
use-cross: false
- os: windows-latest
artifact_name: diffsitter.exe
target: x86_64-pc-windows-msvc
use-cross: false

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -169,7 +173,7 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: "3.9"
python-version: '3.9'

- name: Get release download URL
uses: actions/download-artifact@v2
Expand Down
93 changes: 57 additions & 36 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

env:
CARGO_TERM_COLOR: always
Expand All @@ -16,39 +16,60 @@ jobs:
strategy:
matrix:
job:
- { os: macos-latest, target: x86_64-apple-darwin, use-cross: false }
- { os: ubuntu-latest , target: x86_64-unknown-linux-gnu, use-cross: false }
- { os: ubuntu-latest, target: i686-unknown-linux-gnu, use-cross: true }
- { os: ubuntu-latest, target: arm-unknown-linux-gnueabihf, use-cross: true }
- { os: ubuntu-latest, target: aarch64-unknown-linux-gnu, use-cross: true }
- { os: macos-latest, target: x86_64-apple-darwin, use-cross: false }
- {
os: ubuntu-latest,
target: x86_64-unknown-linux-gnu,
use-cross: false,
}
- {
os: ubuntu-latest,
target: i686-unknown-linux-gnu,
use-cross: true,
}
- {
os: ubuntu-latest,
target: arm-unknown-linux-gnueabihf,
use-cross: true,
}
- {
os: ubuntu-latest,
target: aarch64-unknown-linux-gnu,
use-cross: true,
}
- {
os: windows-latest,
target: x86_64-pc-windows-msvc,
use-cross: false,
}
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.job.target }}
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
with:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.job.target }}
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
with:
key: ${{ matrix.job.target }}
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
use-cross: ${{ matrix.job.use-cross }}
args: --locked --target ${{ matrix.job.target }} --features better-build-info,static-grammar-libs,dynamic-grammar-libs
- name: Unit tests
uses: actions-rs/cargo@v1
with:
command: test
use-cross: ${{ matrix.job.use-cross }}
args: --locked --target ${{ matrix.job.target }} --verbose --features better-build-info,static-grammar-libs,dynamic-grammar-libs
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
use-cross: ${{ matrix.job.use-cross }}
args: --locked --target ${{ matrix.job.target }} --features better-build-info,static-grammar-libs,dynamic-grammar-libs
- name: Unit tests
uses: actions-rs/cargo@v1
with:
command: test
use-cross: ${{ matrix.job.use-cross }}
args: --locked --target ${{ matrix.job.target }} --verbose --features better-build-info,static-grammar-libs,dynamic-grammar-libs

0 comments on commit 2a32fcc

Please # to comment.