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

Fix CI not getting codecov secret and update dependencies #74

Merged
merged 19 commits into from
Jul 30, 2023
Merged
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
31 changes: 14 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,17 @@ jobs:
name: Get variables
runs-on: ubuntu-latest
outputs:
CODECOV_TOKEN: ${{ steps.secrets.outputs.CODECOV_TOKEN }}
DENO_DIR: ${{ steps.deno_dir.outputs.DENO_DIR }}
DENO_DIR: ${{ steps.deno-dir.outputs.DENO_DIR }}
HAS_CODECOV_TOKEN: ${{ steps.secrets.outputs.HAS_CODECOV_TOKEN }}
steps:
- id: secrets
name: Get secrets
if: env.CODECOV_TOKEN != ''
run: |
if ["${{ secrets.CODECOV_TOKEN }}" != ""];
then
echo "CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}" >> $GITHUB_OUTPUT
- id: deno_dir
- id: deno-dir
name: Get cache directory
run: |
echo "DENO_DIR=${{ runner.temp }}/deno_dir" >> $GITHUB_OUTPUT
echo "DENO_DIR=${{ runner.temp }}/deno_dir" >> $GITHUB_OUTPUT;
- id: secrets
name: Check secrets
run: |
echo "HAS_CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN != '' }}" >> $GITHUB_OUTPUT;
lint:
name: Lint
runs-on: ubuntu-latest
Expand Down Expand Up @@ -100,26 +97,26 @@ jobs:
working-directory: ${{ inputs.working-directory }}
if: |
matrix.os != 'ubuntu-latest'
|| !needs.variables.outputs.CODECOV_TOKEN
|| !needs.variables.outputs.HAS_CODECOV_TOKEN
run: deno test ${{ inputs.test-args }} .
- name: Run tests and collect coverage
working-directory: ${{ inputs.working-directory }}
if: |
matrix.os == 'ubuntu-latest'
&& needs.variables.outputs.CODECOV_TOKEN
&& needs.variables.outputs.HAS_CODECOV_TOKEN
run: deno test --coverage=cov ${{ inputs.test-args }} .
- name: Generate coverage
working-directory: ${{ inputs.working-directory }}
if: |
matrix.os == 'ubuntu-latest'
&& needs.variables.outputs.CODECOV_TOKEN
run: deno coverage --lcov=cov ${{ inputs.test-args }} > cov.lcov
&& needs.variables.outputs.HAS_CODECOV_TOKEN
run: deno coverage --lcov cov > cov.lcov
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
files: ${{ inputs.working-directory }}/cov.lcov
token: ${{ needs.variables.outputs.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
if: |
matrix.os == 'ubuntu-latest'
&& needs.variables.outputs.CODECOV_TOKEN
&& needs.variables.outputs.HAS_CODECOV_TOKEN
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Udibo React App

[![release](https://img.shields.io/badge/release-0.17.0-success)](https://github.com/udibo/react_app/releases/tag/0.17.0)
[![deno doc](https://doc.deno.land/badge.svg)](https://deno.land/x/udibo_react_app@0.17.0)
[![release](https://img.shields.io/badge/release-0.18.0-success)](https://github.com/udibo/react_app/releases/tag/0.18.0)
[![deno doc](https://doc.deno.land/badge.svg)](https://deno.land/x/udibo_react_app@0.18.0)
[![CI/CD](https://github.com/udibo/react_app/actions/workflows/main.yml/badge.svg)](https://github.com/udibo/react_app/actions/workflows/main.yml)
[![codecov](https://codecov.io/gh/udibo/react_app/branch/main/graph/badge.svg?token=G5XCR01X8E)](https://codecov.io/gh/udibo/react_app)
[![license](https://img.shields.io/github/license/udibo/react_app)](https://github.com/udibo/react_app/blob/main/LICENSE)
Expand Down Expand Up @@ -31,13 +31,13 @@ Apps are created using [React Router](https://reactrouter.com),

This module has 2 entry points.

- [mod.tsx](https://deno.land/x/udibo_react_app@0.17.0/mod.tsx): For use in code
- [mod.tsx](https://deno.land/x/udibo_react_app@0.18.0/mod.tsx): For use in code
that will be used both on the server and in the browser.
- [server.tsx](https://deno.land/x/udibo_react_app@0.17.0/server.tsx): For use
- [server.tsx](https://deno.land/x/udibo_react_app@0.18.0/server.tsx): For use
in code that will only be used on the server.

You can look at the [examples](#examples) and
[deno docs](https://deno.land/x/udibo_react_app@0.17.0) to learn more about
[deno docs](https://deno.land/x/udibo_react_app@0.18.0) to learn more about
usage.

### Examples
Expand Down
6 changes: 3 additions & 3 deletions build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { walk } from "std/fs/walk.ts";
import { ensureDir } from "std/fs/ensure_dir.ts";
import * as path from "std/path/mod.ts";
import * as esbuild from "x/esbuild/mod.js";
import { denoPlugin } from "x/esbuild_deno_loader/mod.ts";
import { denoPlugins } from "x/esbuild_deno_loader/mod.ts";

import { isProduction, isTest } from "./env.ts";
import { ROUTE_PARAM, ROUTE_WILDCARD, routePathFromName } from "./server.tsx";
Expand Down Expand Up @@ -496,7 +496,7 @@ export async function build(options: BuildOptions) {
);
await ensureDir(outdir);

const importMapURL = path.toFileUrl(importMapUrl);
const importMapURL = path.toFileUrl(importMapUrl).toString();

const buildOptions: esbuild.BuildOptions = isProduction()
? { minify: true }
Expand All @@ -515,7 +515,7 @@ export async function build(options: BuildOptions) {
const esbuildPlugins = options.esbuildPlugins ?? [];
await esbuild.build({
plugins: [
denoPlugin({ importMapURL }),
...denoPlugins({ importMapURL }),
...esbuildPlugins,
],
absWorkingDir: workingDirectory,
Expand Down
Loading