Skip to content

Commit

Permalink
Merge branch 'main' of github.com:romnn/cargo-feature-combinations in…
Browse files Browse the repository at this point in the history
…to main
  • Loading branch information
romnn committed Jul 3, 2023
2 parents 496ea94 + ae4e8fe commit 7fa4324
Show file tree
Hide file tree
Showing 11 changed files with 976 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.0.10
current_version = 0.0.14
commit = True
tag = True

Expand Down
14 changes: 14 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* eslint-env node */

module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
],
// check using: DEBUG=eslint:cli-engine yarn run lint
ignorePatterns: ["node_modules/", "dist/", "jest.config.cjs"],
};
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ jobs:
steps:
- uses: actions/checkout@v3
- id: query
uses: romnn/query-git-action@master
uses: romnn/query-git-action@main
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target.arch }}

- name: Build ${{ matrix.bin }} (${{ matrix.target.arch }})
use: actions-rs/cargo@v1
uses: actions-rs/cargo@v1
with:
use-cross: ${{ contains(matrix.target.os, 'ubuntu') }}
command: build
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: publish/*
tag: ${{ steps.query.outputs.stable_semver_version }}
release_name: ${{ steps.query.outputs.stable_semver_version }}
tag: ${{ steps.query.outputs.semver_version }}
release_name: ${{ steps.query.outputs.semver_version }}
overwrite: true
file_glob: true
48 changes: 48 additions & 0 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: test-action

on:
push:
tags-ignore:
- '**'

jobs:
feature-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.feature-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: romnn/cargo-feature-combinations@main

- name: Compute feature matrix
id: feature-matrix
run: >-
echo "matrix=$(cargo fc matrix)"
>> "$GITHUB_OUTPUT"
- name: Print feature matrix
run: |
echo "${{ steps.feature-matrix.outputs.matrix }}"
test-features:
name: test ${{ matrix.package.name }} (${{ matrix.package.features }})
runs-on: ubuntu-latest
needs: [feature-matrix]
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.feature-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Test
run: >-
cargo test
--package "${{ matrix.package.name }}"
--features "${{ matrix.package.features }}"
--all-targets
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on: [push, pull_request, workflow_call]
jobs:
test:
runs-on: ubuntu-latest
name: test
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
Expand All @@ -22,7 +21,6 @@ jobs:
--examples
-- -Dclippy::all -Dclippy::pedantic
publish:
name: publish (dry-run)
runs-on: ubuntu-latest
Expand Down
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
.DS_Store
**/node_modules
**/dist
**/kubeconfig.yml
**/originals
**/test_originals
/node_modules
/target

# local env files
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-feature-combinations"
version = "0.0.10"
version = "0.0.14"
edition = "2021"
authors = ["romnn <contact@romnn.com>"]
description = "run cargo commands for all feature combinations"
Expand Down
3 changes: 1 addition & 2 deletions action.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as core from "@actions/core";
import * as exec from "@actions/exec";
import {
parseCargoPackageManifestAsync,
Repo,
Expand Down Expand Up @@ -50,7 +49,7 @@ async function run(): Promise<void> {

// cargo-fc-x86_64-unknown-linux-gnu.tar.gz
const bin = "cargo-fc";
const asset = `${bin}-action-${arch}-unknown-${platform}-gnu.tar.gz`;
const asset = `${bin}-${arch}-unknown-${platform}-gnu.tar.gz`;

let downloaded;
try {
Expand Down
7 changes: 7 additions & 0 deletions dist/index.js

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,24 @@
"description": "Download and cache github action release binaries",
"scripts": {
"build": "rimraf ./dist && ncc build action.ts --minify --out ./dist",
"run": "ts-node action.ts",
"check": "tsc --noEmit",
"format": "prettier *.json *.ts --write"
"format": "prettier *.json *.ts *.cjs --write",
"lint": "eslint . --ext .js,.cjs,.ts,.cts, --fix"
},
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1",
"action-get-release": "^0.0.12"
"action-get-release": "^0.0.15"
},
"devDependencies": {
"@types/node": "^18.16.3",
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
"@vercel/ncc": "^0.36.1",
"eslint": "^8.39.0",
"rimraf": "^5.0.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
}
}
Loading

0 comments on commit 7fa4324

Please sign in to comment.