Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP1 #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

WIP1 #13

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 0 additions & 102 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,110 +3,8 @@ name: CI
on: [push, pull_request]

jobs:
build:
name: Build
runs-on: ubuntu-22.04
container:
image: "ubuntu:22.04"
steps:
- uses: actions/checkout@v2
- name: Install required dependencies
run: |
apt update
apt install -y sudo
sudo apt install --yes --no-install-recommends git
# workaround for https://github.com/actions/runner/issues/2033
- name: ownership workaround
run: git config --global --add safe.directory '*'

- name: Setup .NET
run: |
# We need to install `ca-certificates`, otherwise we get these errors in the CI:
# Unable to load the service index for source https://api.nuget.org/v3/index.json.
# The SSL connection could not be established, see inner exception.
# The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot
apt install --yes --no-install-recommends ca-certificates

apt install --yes --no-install-recommends dotnet6

- name: Compile the conventions solution
run: dotnet build --configuration Release conventions.sln
- name: Compile F# scripts
run: dotnet fsi scripts/compileFSharpScripts.fsx

file-conventions-tests:
name: Run FileConventions-lib unit tests
needs: build
runs-on: ubuntu-22.04
container:
image: "ubuntu:22.04"
steps:
- uses: actions/checkout@v2
- name: Install required dependencies
run: |
apt update
apt install --yes sudo

- name: Setup .NET
run: |
# We need to install `ca-certificates`, otherwise we get these errors in the CI:
# Unable to load the service index for source https://api.nuget.org/v3/index.json.
# The SSL connection could not be established, see inner exception.
# The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot
apt install --yes --no-install-recommends ca-certificates

apt install --yes --no-install-recommends dotnet6

- name: Run tests to validate F# scripts
run: dotnet test src/FileConventions.Test/FileConventions.Test.fsproj

commitlint-plugins-tests:
name: Run commitlint-related tests
needs: build
runs-on: ubuntu-22.04
container:
image: "ubuntu:22.04"
steps:
- uses: actions/checkout@v2
- name: Install required dependencies
run: |
apt update
apt install --yes sudo
sudo apt install --yes --no-install-recommends git ca-certificates

sudo apt install --yes --no-install-recommends npm curl
# need to update nodejs because with ubuntu's default nodejs version we would get this error:
# error @jest/[email protected]: The engine "node" is incompatible with this module. Expected version "^14.15.0 || ^16.10.0 || >=18.0.0". Got "12.22.9"
sudo npm install --global n
sudo n lts
- name: Print versions
run: |
git --version
node --version
npm --version
- name: Install yarn
run: |
npm install --global yarn
yarn add --dev jest typescript ts-jest @types/jest
- name: Install commitlint
run: |
npm install conventional-changelog-conventionalcommits
npm install commitlint@latest
- name: Print versions
run: |
git --version
node --version
npm --version
npx commitlint --version
yarn --version
- name: Run tests to validate our plugins
run: yarn jest

sanity-check:
name: Sanity check
needs:
- file-conventions-tests
- commitlint-plugins-tests
runs-on: ubuntu-22.04
container:
image: "ubuntu:22.04"
Expand Down
6 changes: 5 additions & 1 deletion scripts/detectNotUsingGitPush1by1.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,11 @@ let GitHubApiCall (url: string) (accessToken: string) =
client.DefaultRequestHeaders.Add("User-Agent", userAgent)
client.DefaultRequestHeaders.Add("X-GitHub-Api-Version", xGitHubApiVersion)

if not(String.IsNullOrEmpty accessToken) then
if String.IsNullOrEmpty accessToken then
Console.WriteLine "GitHubToken is not provided."
else
Console.WriteLine "GitHubToken is provided."

client.DefaultRequestHeaders.Add(
"Authorization",
$"token {accessToken}"
Expand Down