Skip to content

Commit

Permalink
GitHub local actions test
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielesvelto committed Mar 6, 2024
1 parent 257b3a6 commit a3bb475
Show file tree
Hide file tree
Showing 21 changed files with 9,033 additions and 4 deletions.
11 changes: 11 additions & 0 deletions .github/actions/toolchain/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
max_line_length = 80
indent_size = 4

[*.yml]
indent_size = 2
19 changes: 19 additions & 0 deletions .github/actions/toolchain/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.eslint.json"
},
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier",
"prettier/@typescript-eslint"
],
"rules": {
"@typescript-eslint/ban-ts-ignore": "off"
}
}
73 changes: 73 additions & 0 deletions .github/actions/toolchain/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Continuous integration

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Create npm configuration
run: echo "//npm.pkg.github.com/:_authToken=${token}" >> ~/.npmrc
env:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v1
- run: npm ci
# Temporary disabling in order to release urgent fix
# - run: npm run lint
- run: npm run build
- run: npm run test

install_stable:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
- uses: actions/checkout@v1
- id: toolchain
uses: ./
with:
toolchain: stable
- name: Test toolchain outputs
env:
RUSTC: ${{ steps.toolchain.outputs.rustc }}
RUSTC_HASH: ${{ steps.toolchain.outputs.rustc_hash }}
CARGO: ${{ steps.toolchain.outputs.cargo }}
RUSTUP: ${{ steps.toolchain.outputs.rustup }}
run: |
echo $RUSTC
echo $RUSTC_HASH
echo $CARGO
echo $RUSTUP
install_nightly:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ./
with:
profile: minimal
toolchain: nightly
components: rustfmt, clippy

install_stable_in_docker:
runs-on: ubuntu-latest
container: ubuntu:latest # Docker image, not the GitHub Actions VM
steps:
# `rustup` will need `curl` or `wget` later
- run: apt-get update && apt-get install -y curl
- uses: actions/checkout@v1
- uses: ./
with:
toolchain: stable

install_stable_through_rust_toolchain_file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: echo "stable" > ./rust-toolchain
- uses: ./
94 changes: 94 additions & 0 deletions .github/actions/toolchain/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
__tests__/runner/*

# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# IntelliJ IDEs
.idea
1 change: 1 addition & 0 deletions .github/actions/toolchain/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@actions-rs:registry=https://npm.pkg.github.com
49 changes: 49 additions & 0 deletions .github/actions/toolchain/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.6] - 2020-03-24

### Added

- Pass `allow-downgrade` flag to `rustup` if `nightly` toolchain with components requested

## [1.0.5] - 2020-01-26

### Fixed

- `rustup` version parser does not fail Action execution on `macOS-latest` VM images anymore

## [1.0.4] - 2020-01-26

### Added

- Support for the `rust-toolchain` file: If the toolchain input is not given, we will try and install the version specified in the `rust-toolchain` file.
- Action outputs with `rustc`, `cargo` and `rustup` versions installed

## [1.0.3] - 2019-10-19

### Added

- Support for `rustup set profile` command
- Support for `--component` flag for the `rustup toolchain install` command

## [1.0.2] - 2019-10-14

### Changed

- Missing `rustup` executable will not raise an annotating warning before the installation anymore (#13)

## [1.0.1] - 2019-10-05

### Changed

- `target` input is not used as a `--default-target` argument for `rustup` anymore (#8)

## [1.0.0] - 2019-09-15

### Added

- First public version
22 changes: 22 additions & 0 deletions .github/actions/toolchain/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

The MIT License (MIT)

Copyright (c) 2019 actions-rs team and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Loading

0 comments on commit a3bb475

Please sign in to comment.